今天,当我使用 chromedriver 运行 selenium 时,我在控制台上收到此消息。我该如何抑制这种情况?
DevTools listening on ws://127.0.0.1:12740/devtools/browser/97101fe4-3b1f-42b0-b5c8-373cc18040b6
相关代码:
from selenium import webdriver
driver = webdriver.Chrome(executable_path='c:/bin/chromedriver233')
我使用 2.30 版本的 chromedriver 得到同样的消息。
我之前没有收到过这条消息。我所做的唯一更改是将 chrome 更新到版本 62.0.3202.94(官方版本)(64 位)
Python 3.6.3 64、硒 3.4.3、Windows 7 64。
编辑:我在 Chrome 产品论坛上发布了一个问题https://productforums.google.com/forum/#!topic/chrome/Dlk2j_JpmxE;context-place=forum/chrome https://productforums.google.com/forum/#!topic/chrome/Dlk2j_JpmxE;context-place=forum/chrome
我遇到了同样的问题,做了一些挖掘,终于找到了一个可行的解决方案。这应该删除DevTools
弹出消息:
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.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)