2

当我为 Chrome 启动一个分裂浏览器对象时,我会得到一个黄色横幅,上面写着“你正在使用不受支持的命令行标志......”我找到了一种使用 selenium 摆脱它的方法。

browser = Browser('chrome')
options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"])
browser = webdriver.Chrome(chrome_options=options)

如您所见,它实际上是启动浏览器两次,但我只希望 Chrome 弹出一次。有没有办法使用 Selenium 启动 Splinter 对象的浏览器?

4

1 回答 1

1

I didn't find any way to do that. I'm using custom selenium version with this patch

https://github.com/artyomboyko/splinter/commit/934a254028887d2abc001e44d7ceceb37700c02d

Now I can do this

from selenium.webdriver.chrome.options import Options
from splinter import Browser

options = Options()
options.add_argument('test-type')
browser = Browser('chrome', options=options)

I will try make pull request, sorry but never done it before.

于 2014-09-20T20:34:40.123 回答