【问题标题】:How to skip the DEBUG logs with in the console using Selenium and Python如何使用 Selenium 和 Python 在控制台中跳过调试日志
【发布时间】:2022-01-19 11:33:39
【问题描述】:

我在 python 中使用 Selenium。 我在输出中得到了这些:

我想跳过。 所以请告诉我如何跳过这些警告。

【问题讨论】:

标签: python selenium google-chrome selenium-webdriver selenium-chromedriver


【解决方案1】:

要抑制 DEBUG 日志,您可以通过 Options() 的实例使用 add_experimental_option(),如下所示:

options = Options()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(executable_path=r'C:\BrowserDrivers\chromedriver.exe', options=options)
driver.get("https://www.google.com/")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-01-21
    • 2017-10-03
    • 1970-01-01
    • 2019-04-19
    • 2021-12-22
    • 1970-01-01
    • 2013-11-05
    • 2018-06-12
    相关资源
    最近更新 更多