How to suppress console error / warning / message messages when running selenium python scripts using chrome canary

I am using a Python script (full link to the script below) for a selenium test using Chrome Canary. The test seems to work fine, however, the console displays a lot of error messages / warnings / information.

Is there any way to suppress these messages? I tried: chrome_options.add_argument ("--silent") but does not help. I can not find the right solution. I appreciate any help.

Python script: here is an example script

Python: 3.6.3 Selenium: 3.6.0 Chrome Canary: 63.0.3239.5 (64 bit) ChromeDriver: 2.33

Console messages

+13
source share
3

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

log-level: 
Sets the minimum log level.
Valid values are from 0 to 3: 

    INFO = 0, 
    WARNING = 1, 
    LOG_ERROR = 2, 
    LOG_FATAL = 3.

default is 0.
+20

.

Chromium

"- . : 0 3: INFO = 0, WARNING = 1, LOG_ERROR = 2, LOG_FATAL = 3.

+1

"--log-level" ( 75.0.3770.100 ), :

options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(executable_path='<path-to-chrome>', options=options)

:

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

Python: DevTools ws://127.0.0.1

0

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


All Articles