2024-04-19 11:08:11 发布
网友
我试过了:
driver.service.stop()
完整代码:
但它没有关闭控制台日志/命令行.exe在
您无法在Chrome驱动程序中完全隐藏它,但您可以抑制少数,并设置最低日志级别,如下所示:
from selenium.webdriver.chrome.options import Options chrome_options = Options() chrome_options.add_argument('log-level=2')
其中日志级别为
#Combine this two options: from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.desired_capabilities import DesiredCapabilities options = Options() options.add_argument(' log-level=3') dc = DesiredCapabilities.CHROME dc['loggingPrefs'] = {'driver': 'OFF', 'server': 'OFF', 'browser': 'OFF'} self.driver = webdriver.Chrome(chrome_options=options, desired_capabilities=dc, executable_path="C:\\path\\chromedriver.exe")
您无法在Chrome驱动程序中完全隐藏它,但您可以抑制少数,并设置最低日志级别,如下所示:
其中日志级别为
^{pr2}$相关问题 更多 >
编程相关推荐