Try to search your question here, if you can't find : Ask Any Question Now ?

Python Selenium: How to fix 'StaleElementReferenceException'

HomeCategory: stackoverflowPython Selenium: How to fix 'StaleElementReferenceException'
Avatarpushpa asked 2 weeks ago

I’m trying to extract past one year prices from (

I’ve tried several ways to do that, however I always end up losing login details and unable to download the file.
Here’s my recent code:

from import WebDriverWait
from import By
from import WebDriverWait
from import expected_conditions as EC
from selenium.common.exceptions import TimeoutException

options = webdriver.ChromeOptions()
preferences = {"download.default_directory" : "D:scrapping",
               "safebrowsing.enabled": False}
options.add_experimental_option("prefs", preferences)

driver = webdriver.Chrome(options = options, 
                          executable_path = 'D:\chromedriver.exe')

driver.find_element_by_xpath("""//input[@type = "email"]""").send_keys(************).click()
driver.find_element_by_xpath("""//input[@type = "password"]""").send_keys(*********).click()


element1 = driver.find_element_by_xpath("""//button[@title="1 year"]""")
element2 = driver.find_element_by_xpath("""//div[@class="pull-right context-menu btn-group"]""")
element3 = driver.find_element_by_xpath("""//*[@id="chartmenu"]/li/a""")

hoverover = ActionChains(driver).move_to_element(element1).move_to_element(

As I said, unable to download the file and get an error which says not signed in. Where am I wrong here? Please help!

1 Answers
Best Answer
AvatarMikhail answered 2 weeks ago
Your Answer

1 + 20 =

Popular Tags

WP Facebook Auto Publish Powered By :