Selenium Chromedriver disable log on Windows

2019-06-01 20:31发布

I am running selenium via python 3 with the chromedriver browser on windows 10.

The program is very active and should run constantly. Means: lots of logging going on.

Problem: the crhomedriver logs get way too long after a few hours, and windows tends to crash.

enter image description here

Everything is working fine, the logs are just minor issues about which I do not really care.

Question:

How may I disable the chromedriver logs?

Notes:

  • I did my research and did not find any working solution yet.
  • I am forced to use chromedriver, hence no headless browser like phantomJS is a valid alternative.

1条回答
小情绪 Triste *
2楼-- · 2019-06-01 20:38

Try this, not sure it will work. Pass the options to your chromedriver

from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument('--disable-logging')
查看更多
登录 后发表回答