Simple question: how to completely disable logging when using Selenium from Python bindings, ex code as follows:
browser = webdriver.Chrome()
I've tried things like:
options = webdriver.ChromeOptions();
options.add_argument('--log-level 3')
browser = webdriver.Chrome(chrome_options=options)
or even:
options = webdriver.ChromeOptions();
options.add_argument('--disable-logging')
browser = webdriver.Chrome(chrome_options=options)
but still the file 'chromedriver.log' is appearing on each new run of the tests.
The source code of Chrome's webdriver, shows the existence of an option called
service_log_path
.So if you want to get rid of the file, you could set this property to
/dev/null
if you are running under Linux/Unix ;NUL
under windowsHope it helps
Just example for Windows people:
Accepted answer is correct, but if you are new to Python / windows like i am, example like this will cut you few hours of google time.