staleelementreferenceexception

Python & Selenium: Iterate through list of WebElements Error: StaleElementReferenceException

一笑奈何 提交于 2021-02-11 18:22:29
问题 Good afternoon, Somewhat new to Python and webscraping, so any help would be greatly appreciated! First: The Code from selenium import webdriver import time chrome_path = r"/Users/ENTER/Desktop/chromedriver" driver = webdriver.Chrome(chrome_path) site_url = 'https://www.home-school.com/groups/' driver.get(site_url) # get state links from sidebar and store to list area = driver.find_element_by_xpath("""/html/body/center/table/tbody/tr/td/table[3]/tbody/tr/td[2]/div""") items = area.find

StaleElementReferenceException even when having explicit wait

孤街浪徒 提交于 2021-02-11 06:52:52
问题 I've been trying to crawl data from the website AlgoExplorer. It has a table with pagnigation to store data. Even though I use an Explicit Wait for clicking a 'next' button, it still get StaleException. Here is a piece of my code, and an image of error: for i in tqdm(range(5)): page = driver.find_element_by_tag_name('tbody').find_elements_by_tag_name('a') for e in page: pages.append(e.text) WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.CSS_SELECTOR, '.pagination.next'))).click

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

北城以北 提交于 2021-01-16 04:09:48
问题 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 = Options() browser = webdriver.Chrome(chrome_options= options,executable_path=r'C:\Users...chromedriver.exe') browser.get('http://.../') Then I am implementing the part to work on the dropdown. My goal is to perform something for each dropdown

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

。_饼干妹妹 提交于 2021-01-16 04:07:34
问题 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 = Options() browser = webdriver.Chrome(chrome_options= options,executable_path=r'C:\Users...chromedriver.exe') browser.get('http://.../') Then I am implementing the part to work on the dropdown. My goal is to perform something for each dropdown

StaleElementReferenceException: element is not attached to the page document while selecting the options from multiple Dropdowns using Selenium Python

萝らか妹 提交于 2020-08-10 19:30:18
问题 Code trial: #coding=utf-8 from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select, WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time import pandas as pd # Below is to crawl data from a webpage with two different dropdown try: driver = webdriver.Chrome('./chromedriver') driver.get('https://price.joinsland.joins.com/theme/index_theme.asp

StaleElementReferenceException: element is not attached to the page document while selecting the options from multiple Dropdowns using Selenium Python

耗尽温柔 提交于 2020-06-23 13:29:47
问题 Code trial: #coding=utf-8 from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select, WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time import pandas as pd # Below is to crawl data from a webpage with two different dropdown try: driver = webdriver.Chrome('./chromedriver') driver.get('https://price.joinsland.joins.com/theme/index_theme.asp

StaleElementReferenceException: element is not attached to the page document while selecting the options from multiple Dropdowns using Selenium Python

痞子三分冷 提交于 2020-06-23 13:28:45
问题 Code trial: #coding=utf-8 from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select, WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time import pandas as pd # Below is to crawl data from a webpage with two different dropdown try: driver = webdriver.Chrome('./chromedriver') driver.get('https://price.joinsland.joins.com/theme/index_theme.asp

StaleElementReferenceException when trying to click on the links in a loop

廉价感情. 提交于 2020-01-11 13:45:08
问题 Please click on the link below to see the link "BEAUTY" on which I am clicking 1. I am using this code to click on the "Beauty" link driver = webdriver.Chrome("C:\\Users\\gaurav\\Desktop\\chromedriver_win32\\chromedriver.exe") driver.maximize_window() driver.get("http://shop.davidjones.com.au") object = driver.find_elements_by_name('topCategory') for ea in object: print ea.text if ea.text == 'Beauty': ea.click() I am getting the following exceptions after clickin on the link succesfully , can

“StaleElementReferenceException” in Selenium for a List<WebElement>

喜欢而已 提交于 2020-01-06 08:19:06
问题 Please refer the below code, this code will fetch all the orderID from findtable method and it passes all of the orderID to clickonIndividualOrderID method so the cursor moves to each orderid and it clicks on it, a new page will come and it fetch the status and clicks on done and it comes back to old page now if we try to select next orderID, it will throw the exeception Could you please suggest some approaches to resolve this issue Thanks in advance List<WebElement> orderID = new ArrayList

Stale exception error while browsing through for loop

不羁岁月 提交于 2020-01-06 06:01:17
问题 from selenium import webdriver from selenium.webdriver.support.ui import Select import time path_to_chromedriver = 'C:/Users/WIN7/AppData/Local/Programs/Python/Python37-32/chromedriver.exe' browser = webdriver.Chrome(executable_path=path_to_chromedriver) browser.get('https://shipped.com/shipping-containers-for-sale.php') Country_Click = browser.find_element_by_xpath("//select[@name='country']") all_options = Country_Click.find_elements_by_tag_name("option") for option in all_options: print(