selenium 只有谷歌浏览器有无头模式么 edge有无头模式么?
chrome_options!
path = "msedgedriver.exe"
EDGE = {
"browserName": "MicrosoftEdge",
"version": "",
"platform": "WINDOWS",
# 关键是下面这个
"ms:edgeOptions": {
'extensions': [],
'args': [
'--headless',
'--disable-gpu',
'--remote-debugging-port=9222',
]}
}
self.browser = webdriver.Edge(executable_path=path, capabilities=EDGE)
可以这样,通过设置capabilities参数来实现,这个最后会传给WebDriver.__init__()的desired_capabilities,
webdriver.Chrome实际上也是将options传给desired_capabilities
对啊,我也好奇Edge怎么开启无头模式??
火狐
有的啊,去这个地址:https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
对应的Edge版本自行选择下载,就可以了。
在地址栏输入edge://version/
查看Edge的版本,对应版本进行下载就可以了。
不是,我不是要他的驱动程序,是无头浏览
我知道火狐也有,因为自己没有下火狐和谷歌
我这就不清楚了,朋友,因为,我只知道谷歌有无头模式啊。
我经常用的也是Google,Google我觉得很香啊,没有什么不好的。
edge有的
真的嘛,怎么用