Chrome devmode turns on unexpectedly in selenium

I use the script daily. This is a headless chrome that just checks the site every 5 minutes and devmode turns on unexpectedly, and I can't turn it off. This is my scenario:

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 conclusion:

[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 provides F12 Developer Console information every time you connect to a new site. : with

+2
source share
2 answers

I managed to fix it finally: D

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

That is all that is needed.

+4
source

I ran into the same problem and adding a log level argument doesn't work just for me.

On Windows, you obviously need to add the following option to ChromeOptions:

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

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

0

Source: https://habr.com/ru/post/1689569/


All Articles