posted 7 years ago
Hi All,
I need to scrap some web page but before I need to do some actions in order to get to it.
I am filling some fields and clicking on a search button and moving to another window.
but the Chrome web driver is still pointing on the previous window. as you can see I am printing the handle windows of the driver before the click and after and I see only one window in the list.
this window is the previous one.
why I see only one?
how can I fix it and that the driver will point on the new one?
my current code :
from selenium import webdriver
browser = webdriver.chrome()
browser.get('https://a836-acris.nyc.gov/DS/DocumentSearch/PartyName')
firstName = browser.find_element_by_name("edt_first")
LastName = browser.find_element_by_name("edt_last")
firstName.send_keys("John")
LastName.send_keys("Smith")
print ('--------------------------------------------------------------------------------------------')
print (browser.window_handles)
browser.find_element_by_name("Submit").click()
print (browser.window_handles)
Thanks