【发布时间】:2014-09-02 19:47:50
【问题描述】:
当我为 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 对象的浏览器?
【问题讨论】:
-
对不起,为什么不只是 options = webdriver.ChromeOptions() options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"]) browser = webdriver.Chrome(chrome_options=options), 我没有浏览器的意思 = Browser('chrome')
-
糟糕,抱歉,有错字。最后一行应该是:browser.driver = webdriver.Chrome(chrome_options=options)。我想实例化一个 Splinter 对象,而不是 Selenium 对象。
标签: python google-chrome selenium web splinter