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
0
votes
2 answers

Stale Element Reference Exception occurred even though I explicitly ignored the exception using ignored_exceptions

Why is the StaleElementReferenceException still raised even though I ignored the exception? The code will eventually run successfully after a few tries but how can I make it wait until the element is clickable to avoid any exception? import sys from…
0
votes
2 answers

Selenium WebDriver crashes when I try to get innerText from an element container

I am trying to get the innerText from all themessage.spoilers-container, but when I scroll up the webpage, the program crashes, and give me an error. Code: from selenium.common.exceptions import NoSuchElementException from…
0
votes
0 answers

Trying to resolve StaleElementReferenceException error

I'm trying to resolve a StaleElementReferenceException error in my selenium code. This is the error message i get: org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document It occurs…
0
votes
1 answer

selenium.common.exceptions.StaleElementReferenceException | python

I am doing web scraping using selenium in python with the following code: from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service…
0
votes
0 answers

StaleElementReferenceException Selenuim Python

I am trying to extract the numbers from the below page but always showed an exception, I tried various solutions but still get StaleElementReferenceException, here is my code.. I tried sleep and wait...., what is the problem?, please options =…
0
votes
0 answers

I am not able to run test parallel in TestNG

When i run without parallel keyword then it run, no exception occure. But when i use parallel keyword and thread-count then it cant run and throw an exception "StaleElementReferenceException: stale element reference: element is not attached to the…
0
votes
3 answers

How can I click this button with selenium in python? getting error: StaleElementReferenceException

error: Traceback (most recent call last): File "C:\Users\m8248\PycharmProjects\pythonProject1-tktopvids\screenshot_comments.py", line 153, in print(f"{day.text} = ? {schedule_date.day}") File…
0
votes
0 answers

stale element reference when scraping linkedin

I am trying to scrape a hashtag feed on linkedin and with my limited knowledge and a lot of googling I managed to cobble together the below. The idea is that I want to be able to go to a hashtag feed scroll through the feed and click "show more"…
0
votes
2 answers

How to visit multiple links with selenium

i'm trying to visit multiple links from one page, and then go back to the same page. links = driver.find_elements(By.CSS_SELECTOR,'a') for link in links: link.click() # visit page # scrape page driver.back() # get back to…
0
votes
0 answers

Scraping cascade selects' text with selenium/c#

This is my first post on stackoverflow, even though i've been lurking in the shadows for past 10 years. :D So, I have a task to scrape data off of a site which contains 3 cascade select lists / dropdowns, call it what ever you like. As I've played…
0
votes
0 answers

How can I continue my Python Selenium script when the element no longer exists on the page? My code works in Jupyter but not PyCharm

I can't search for the element to see if it's even there because Python throws in an error and halts the script, even when using try/catch. while True: jobinfo1 = driver.find_elements(By.XPATH, "//ul[@class = 'jobsearch-ResultsList css-0']/li") …
0
votes
0 answers

selenium webdriver error "element is not attached to the page document" - press the cookie game

I'm trying to create a bot that auto clicks the cookie and auto buys upgrades. Sometimes the bot runs 40 sec then I get the error above and sometimes it take only few seconds. I'll be glad to know what im doing wrong. My code: from selenium import…
0
votes
1 answer

Python Selenium button.click() causes browser console error

I am trying to click through a form on https://www.autozone.com from selenium import webdriver from selenium.webdriver import DesiredCapabilities from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import…
0
votes
1 answer

Selenium error: stale element reference: element is not attached to the page document

i write this code for download image from google from .txt file that has list of strings. If try with only string into code work. from selenium import webdriver from selenium.webdriver.common.keys import Keys import time from…
0
votes
1 answer

Stale Element Reference appears when navigating back to a page, how to write a neat code

I am automating in Java Selenium, without using Page Factory. I have an Add Candidate Button element that is clicked in two tests. One is straightforward, after entering InviteToCompany page I click this button and proceed. However, another requires…