[python] Selenium Scrapper

Viewer

copyrawdownloadembedprintName: Selenium Scrapper
  1. from selenium import webdriver
  2. from selenium.webdriver.chrome.options import Options
  3. from selenium.webdriver.support.ui import WebDriverWait
  4. from selenium.webdriver.support import expected_conditions as EC
  5. from selenium.webdriver.common.by import By
  6. from fake_useragent import UserAgent
  7.  
  8. options = webdriver.ChromeOptions()
  9. options.headless = False
  10. options.add_argument("--no-sandbox")
  11. options.add_argument('--ignore-certificate-errors')
  12. options.add_argument('--ignore-certificate-errors-spki-list')
  13. options.add_argument('--ignore-ssl-errors')
  14. options.add_argument("--disable-gpu")
  15.  
  16. driver = webdriver.Chrome(options=options, executable_path="./chromedriver")
  17. driver.get("https://www.aussar.es/cpu-am4-ryzen/amd-ryzen-5-5600x-box-37ghz.html")
  18.  
  19. WebDriverWait(driver, 2000).until(EC.visibility_of_element_located(
  20. (By.ID, "js-product-list")))
  21.  
  22. #name = driver.find_elements(By.CLASS_NAME, "h1 product-detail-name")
  23. driver.quit()

Editor

You can edit this paste and save as new:


File Description
  • Selenium Scrapper
  • Paste Code
  • 05 May-2021
  • 947 Bytes
You can Share it: