Chrome devmode suddenly turning on in selenium

Viewed 3472

I am using a script daily. It's a headless chrome that just checks a site every 5 minutes and suddenly devmode turned on and i can't seem to turn it off. This is my script:

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('headless')
driver = webdriver.Chrome + 'E:\Chrome Downloads\chromedriver_win32\chromedriver.exe', chrome_options=options)

And the output is:

[0926/111600.894:ERROR:devtools_http_handler.cc(786)]
DevTools listening on 127.0.0.1:12107

[0926/111601.685:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.

It also spews out the F12 developer console info everytime it connects to a new site. :c

2 Answers

I managed to fix it finally :D

options.add_argument('--log-level=3')

That was all it took.

I was running into the same issue and adding the log-level argument only did not work for me.

On Windows you obviously need to add the following option to your ChromeOptions as well:

options.add_experimental_option('excludeSwitches', ['enable-logging'])

As described here: https://bugs.chromium.org/p/chromedriver/issues/detail?id=2907#c3

Related