selenium3下打不开Firefox报错解决


由于安装了最近的selenium3,导致之前正常运行的firefox失败了

报错信息:

selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x00000000024C6278>> ignored

我也不知道为啥百度原因如下

因为最新的selenium3 需要用geckodriver 来驱动,不再使用Seleniu默认自带的Firefox webdriver。

我们只需要在下面这个地址下载 geckodriver 并将 其所在的路径设为环境变量即可解决。

https://github.com/mozilla/geckodriver/releases

然后再次运行 有报错了。。。。阿西吧

selenium.common.exceptions.WebDriverException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line

再次百度。。。。发现需要指定下Firefox的地址 在path 环境下 加上Firefox的路径即可 C:\Program Files (x86)\Mozilla Firefox


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM