how to close Python selenium webdriver window

后端 未结 5 2010
南旧
南旧 2021-02-12 13:30

I have a python script that scraps data off from a website on an hourly basis. It is stored on the server at the moment and is working well as I am using task scheduler to sched

5条回答
  •  南方客
    南方客 (楼主)
    2021-02-12 14:12

    Could'nt you scrape in headless mode? (example for chrome)

    chrome_options = webdriver.ChromeOptions()
    chrome_options.add_argument('--headless')
    chrome_options.headless = True
    ...
    driver = webdriver.Chrome(chrome_options=chrome_options)
    driver.create_options()
    

提交回复
热议问题