[python] Selenium Driver

Viewer

copyrawdownloadembedprintName: Selenium Driver
  1. from selenium import webdriver
  2. from selenium.webdriver.common.by import By
  3. from selenium.webdriver.support.ui import WebDriverWait
  4. from selenium.webdriver.support import expected_conditions as EC
  5. from fake_useragent import UserAgent
  6. import time
  7. options = webdriver.ChromeOptions() 
  8. ua = UserAgent()
  9. UserAgent = ua.random
  10. options.add_argument("start-maximized")
  11. options.add_argument("--headless")
  12. options.add_argument(f'user-agent={UserAgent}')
  13. time.sleep(1)
  14. driver = webdriver.Chrome(options=options, executable_path=r'./chromedriver.exe')
  15. driver.get("https://www.aussar.es/refrigeracion/jonsbo-cr-2000gt-argb-negro-2x-120mm.html")
  16. time.sleep(1)
  17. print(driver.page_source)
  18. driver.quit()

Editor

You can edit this paste and save as new:


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