Questions tagged [staleelementreferenceexception]

StaleElementReferenceException : org.openqa.selenium.StaleElementReferenceException popularly known as StaleElementReferenceException extends org.openqa.selenium.WebDriverException which indicates that a reference to an element is now "stale", which means that the element is no longer attached to the DOM of the page.

StaleElementReferenceException

org.openqa.selenium.StaleElementReferenceException popularly known as StaleElementReferenceException extends org.openqa.selenium.WebDriverException which indicates that a reference to an element is now stale which means that the element is no longer attached to the DOM of the page.

Reference : StaleElementReferenceException

180 questions
1
vote
1 answer

Dynamic Web Scraping with Helium

There is a web page which contains links to multiple articles and I want to be able to visit each of these articles and extract the text contained in them. For this purpose, I have used the Helium Python package and written out a script, however, I…
1
vote
1 answer

How do I prevent a stale element reference and make a WebElement update itself in selenium?

I'm a complete newbie at dealing with python and selenium, just started a week ago, so do excuse my mess of a code. I'm trying to extract all the 'structure_id' and 'd' information from elements with tag name in this website and store each of them…
Kenny
  • 13
  • 3
1
vote
0 answers

Getting "selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document"

Searching "Selenium" word in google, and i want to select a website whose link is in 2nd page . And when automation starts as per the condition it check it in first page since the condition is not satisfied its going to the second page and at that…
1
vote
1 answer

stale element reference element is not attached to the page document when trying to scrape information from different links

I am using Selenium on Python and trying to move the cursor and click on a specific element. This works for the first link and the structure of the HTML is the same for the next link but I get a StaleElementReferenceException for the second link…
1
vote
0 answers

Require Logic to avoid "StaleElementReferenceException" after page refresh

I am having multiple links on a Webpage. After clicking the link, a popup opens, I Set some values on fields in the popup and click on 'Save'. On clicking on 'Save', the main web page refreshes to show the updated status of the link. I use a "for"…
1
vote
1 answer

Selenium returning to previous page in a for loop

I'm making a scraper to scrape a betting website for its data, this is an example piece of code that will scrape the event, teams and odds. The idea is to iterate through all the competitions that are available for the sport. I am able to locate the…
1
vote
1 answer

Message: stale element reference: element is not attached to the page document while clicking on multiple links on the webpage using Selenium Python

I'm trying to click on every possible course links on this page, but it gave me this error: Message: stale element reference: element is not attached to the page document This is my code: driver =…
1
vote
1 answer

StaleElementReferenceException: Message: stale element reference: element is not attached to the page document with Selenium and Python

I am working on selenium for a website that consists of dropdown menu. At first, we have the basic codes: from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import Select options…
1
vote
0 answers

Can I even use List in Selenium without getting StaleElementException?

Similar questions were already asked a million times but I still haven't figured out the correct way how to solve this problem. First question: Is it bad practice to iterate through a List of Webelements in Selenium? I am a big fan of Lists in Java.…
cepi1993
  • 35
  • 5
1
vote
0 answers

Still getting StaleElementReferenceException while looping even though I refresh the references

I'm trying to create a bot for Quizlet for fun, but I've encountered this problem for "Match." Essentially, the program should drag and drop tiles to other tiles in order to match them all and make them disappear. All the elements are already…
1
vote
2 answers

Switch to iframe and click on element doesn't work and get StaleElementReferenceException

I'm doing practise on this website: https://dojotoolkit.org/reference-guide/1.9/dijit/layout/TabContainer-examples.html Click on Run button in Programmatic Nested tabs section with following method: WebElement productElement = null; …
1
vote
2 answers

How to access multiple html table column data with selenium

I am trying to access a certain row based on the column data and then click the link in that row. How do I achieve this? I've been stuck on this for 5 days. I am new to Selenium but I have tried looping through the list of elements but then would…
1
vote
0 answers

StaleElementReferenceException only occuring with ActionChains / Python3, Selenium

I am trying to automate a company website where I have to make specific trades. If I want to make one trade at a time rather than in bulk I need to submit a trade and then reload the webpage to submit another trade. Unfortunately the button I need…
1
vote
2 answers

How to prevent StaleElementReferenceException while clicking on each item in the league list using Selenium through Python

Operating on this website: https://www.livetulokset.com/ my_leagues = browser.find_element_by_id('my-leagues-list') # single element leagues = my_leagues.find_elements_by_tag_name('li') # list of elements for i in leagues: i.click() # Click…
1
vote
1 answer

How to extend IWebElement interface to add a new method

I am trying to extend the interface IWebElement in C# to add a new method to protect against StaleElementReferenceException. The method I want to add is a simple retryingClick that will try to click the WebElement up to three times before giving…
elgato
  • 506
  • 1
  • 5
  • 20