Guest User

Untitled

a guest
Aug 7th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
  2.  
  3. import os
  4. import time
  5. from selenium.webdriver.support.ui import WebDriverWait
  6. from selenium.webdriver.support import expected_conditions as EC
  7. from selenium.webdriver.common.by import By
  8. from ..default.helpers import scrapehelper as sh
  9.  
  10. def scrape(username: str, password: str) -> None:
  11. current_dir = os.path.dirname(os.path.abspath(__file__))
  12. driver = sh.get_driver("chrome")
  13. driver.implicitly_wait(20)
  14. driver.get("https://automationdrivestore.com/")
  15. buttons = driver.find_elements_by_class_name("cs-landing-page-btn")
  16. for button in buttons:
  17. button.click()
  18. time.sleep(5)
  19. getNames = driver.find_elements_by_class_name('apps-list__item-name')
  20. for Names in getNames:
  21. # entering site
  22. Names.click()
  23. time.sleep(2)
  24. driver.back()
  25. driver.implicitly_wait(20)
  26. time.sleep(5)
Add Comment
Please, Sign In to add comment