Don't know how to get data from a newly loaded/clicked page using Selenium.
I have 2 questions:
1) I load a page with Selenium (asp) enter some value and a new page loads. On this new page I want to access this data: <td class="queryfield" valign="top">05/09/2019 </td>. How do I do that? How do I make selenium grab data from the 'newly' loaded page and not the original page and how do I access this item specifically - looking to return the 05/09/2019 data.
2) How do I make Selenium wait until the page loads? I currently use sleep(.5) - see my code below. Thanks.
[inline]
I have 2 questions:
1) I load a page with Selenium (asp) enter some value and a new page loads. On this new page I want to access this data: <td class="queryfield" valign="top">05/09/2019 </td>. How do I do that? How do I make selenium grab data from the 'newly' loaded page and not the original page and how do I access this item specifically - looking to return the 05/09/2019 data.
2) How do I make Selenium wait until the page loads? I currently use sleep(.5) - see my code below. Thanks.
[inline]
FMCSA_SNAPSHOT_WEBSITE = "https://safer.fmcsa.dot.gov/CompanySnapshot.aspx" driver = webdriver.Firefox() driver.get(FMCSA_SNAPSHOT_WEBSITE) sleep(.5) input_dot = driver.find_element_by_id('4') sleep(.5) input_dot.send_keys(dot) #use 348313 for dot value as test case input_dot.send_keys(Keys.ENTER) # how do I load data from this new page?[/inline]