How to hide Chromedriver console window?

后端 未结 3 506
时光说笑
时光说笑 2020-12-20 08:13

I have a simple Python script which uses selenium and webdriver to open up Facebook in a Chrome window and log in automatically. When I run it, the Chromedriver console win

3条回答
  •  旧时难觅i
    2020-12-20 08:35

    You need to call driver.quit() at the end of the script:

    quit()

    Closes the browser and shuts down the ChromeDriver executable that is started when starting the ChromeDriver

    If you want to just close the service executable and let the browser stay opened, call:

    driver.service.stop()
    

    FYI, I've figured this out from the quit() method implementation (source code).

提交回复
热议问题