Chrome devmode突然在硒上打开 [英] Chrome devmode suddenly turning on in selenium
本文介绍了Chrome devmode突然在硒上打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
from __future__ import print_function
导入套接字
导入时间
从selenium import webdriver
从selenium.webdriver.common.action_chains中导入随机
导入ActionChains
from selenium.webdriver.common.keys从Tkinter导入键
导入Tk
从selenium.webdriver.common.keys import keys
import os
$ b options = webdriver.ChromeOptions()
options.add_argument('headless')
driver = webdriver。 Chrome +'E:\Chrome Downloads\chromedriver_win32\chromedriver.exe',chrome_options = options)
<输出是:
pre $ [0926 / 111600.894:错误:devtools_http_handler.cc(786)]
DevTools在127.0.0.1:12107
上侦听[0926 / 111601.685:错误:browser_gpu_channel_host_factory.cc(103)]无法启动GPU进程。
每次连接到新网站时,它都会发出F12开发者控制台信息。 :c
解决方案
我最终解决了这个问题:D
options.add_argument(' - log-level = 3')
<这就是所需要的。
I am using a script daily. It's a headless chrome that just checks a site every 5 minutes and suddenly devmode turned on and i can't seem to turn it off. This is my script:
from __future__ import print_function
import socket
import time
from selenium import webdriver
import random
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from Tkinter import Tk
from selenium.webdriver.common.keys import Keys
import os
options = webdriver.ChromeOptions()
options.add_argument('headless')
driver = webdriver.Chrome + 'E:\Chrome Downloads\chromedriver_win32\chromedriver.exe', chrome_options=options)
And the output is:
[0926/111600.894:ERROR:devtools_http_handler.cc(786)]
DevTools listening on 127.0.0.1:12107
[0926/111601.685:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.
It also spews out the F12 developer console info everytime it connects to a new site. :c
解决方案
I managed to fix it finally :D
options.add_argument('--log-level=3')
That was all it took.
这篇关于Chrome devmode突然在硒上打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文