0

I get all rows from web and add to list_web variable

rows = driver.find_elements(By.CLASS_NAME, 'table-row')
list_web += rows 

I have list of selenium elements (single rows from web)

list_web = (
<selenium.webdriver.remote.webelement.WebElement (session="e1948d225e52979d10525d12edb3eba0", element="8f287ad9-3606-479c-b9f7-eeee9c97d45d")>,
<selenium.webdriver.remote.webelement.WebElement (session="e1948d225e52979d10525d12edb3eba0", element="1e72fb8f-7582-4dbe-8248-0cca80ec6251")>
)

I would like to get values of the rows (and then save as dataframe)

I am trying to read the rows

for element in list_web:
    print(element.text)

but i get error

selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
onhalu
  • 735
  • 1
  • 5
  • 17
  • This might help. https://stackoverflow.com/questions/18225997/stale-element-reference-element-is-not-attached-to-the-page-document – Devansh_Jain_21 Dec 02 '22 at 10:41

0 Answers0