Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selenium does not keep the table?
#1
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
Reply


Messages In This Thread
Selenium does not keep the table? - by euras - May-19-2021, 11:34 AM
RE: Selenium does not keep the table? - by Monish - Jun-05-2021, 11:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Selenium getting table element trengan 2 8,505 Dec-31-2018, 03:02 PM
Last Post: trengan
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,587 Nov-03-2017, 08:41 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020