Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
- import os
- import time
- from selenium.webdriver.support.ui import WebDriverWait
- from selenium.webdriver.support import expected_conditions as EC
- from selenium.webdriver.common.by import By
- from ..default.helpers import scrapehelper as sh
- def scrape(username: str, password: str) -> None:
- current_dir = os.path.dirname(os.path.abspath(__file__))
- driver = sh.get_driver("chrome")
- driver.implicitly_wait(20)
- driver.get("https://automationdrivestore.com/")
- buttons = driver.find_elements_by_class_name("cs-landing-page-btn")
- for button in buttons:
- button.click()
- time.sleep(5)
- getNames = driver.find_elements_by_class_name('apps-list__item-name')
- for Names in getNames:
- # entering site
- Names.click()
- time.sleep(2)
- driver.back()
- driver.implicitly_wait(20)
- time.sleep(5)
Add Comment
Please, Sign In to add comment