The web page I am trying to access is using JavaScript to dynamically generate HTML form(this one: https://i.stack.imgur.com/dIDud.jpg ). When typing print(page_source)
, the table seems to appear in the HTML being outputted.
However, after filling the input field and submitting the form, another input field with CAPTCHA image appears(as shown here: https://i.stack.imgur.com/ihPe6.jpg ). After typing print(page_source)
, the input form with the CAPTCHA seems not to be inserted into the HTML.
My question is: How can I access this dynamically generated HTML, which contains the input field and the CAPTCHA image using Selenium?
Here is my code (also, in pastebin):
from selenium import webdriver
driver = webdriver.Chrome("/var/chromedriver/chromedriver")
URL = 'http://nap.bg/link?id=104'
driver.get(URL)
input_field = driver.find_element_by_name('ipID')
input_field.send_keys('0000000000')
driver.find_element_by_id('idSubmit').click()
print(driver.page_source)