I currently click a button into a new window:
browser.execute_script("arguments[0].value = 'test';", browser.find_element_by_xpath('//*[@id="email-signup-email-address"]'))
input_button = browser.find_element_by_xpath('//*[@id="submittracking"]')
browser.execute_script('arguments[0].target="_blank";', input_button.find_element_by_xpath('./ancestor::form'))
browser.execute_script('arguments[0].click();', input_button)
but must time.sleep(10)
before asking browser.page_source
otherwise the page does not load fully
Other articles/posts suggest to use seleniums explicit wait
but this asks to provide an element to wait for such as visibilityOfAllElements()
or some specific element. I would like to get the ALL the page_source and am not looking to identify any elements.
How can I make browser.page_source
work as it normally does (when not clicking into a new window)?