How to suppress console error/warning/info messages when executing selenium python scripts using chrome canary

后端 未结 5 694
囚心锁ツ
囚心锁ツ 2020-12-09 16:21

I am running python script (complete script link below) for selenium test using Chrome Canary. The test seems to be running fine, however, there are lots of error/warning/in

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 16:38

    If "--log-level" doesn't work for you (as of 75.0.3770.100 it didn't for me), this should:

    options = webdriver.ChromeOptions()
    options.add_experimental_option('excludeSwitches', ['enable-logging'])
    driver = webdriver.Chrome(executable_path='', options=options)
    

    see:

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

    Python selenium: DevTools listening on ws://127.0.0.1

提交回复
热议问题