Python Forum

Full Version: Selenium does not keep the table?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I scrape a table with Selenium. When I found the match, I click on the row, which navigates me to the next page. I do a couple of things in that page, then click Back button on that page, which brings me back to the previous page, where the table is. I expect Selenium to grab next row and check the results there, but instead of that, the whole script just stops. Does Selenium not contain the table in variable, if the page loads to the next page and then goes back? In autohotkey it does that. i.e. I found a match in row[4], do some action, click Back, get to the main updated page, and then I expect Selenium to grab row[5] to check and proceed.

contents = driver.find_element_by_id("searchResultTable").find_elements_by_tag_name("tr")
for inda, content in enumerate(contents):
   td = content.find_elements_by_tag_name("td")
   for ind, ttd in enumerate(td):
      if ind == 7:
      # proceeds some actions with a new opened page and click "Back" which brings me back to the main Table
      break
Hi there, I don't know the answer of your query , but if you want to learn selenium with python see this tutorial