WindowsError: [Error 2] The system cannot find the file specified
在ipython notebooks中使用Selenium打开Firefox时出错,我用的是火狐浏览器,代码如下:from selenium import webdriverdriver = webdriver.Firefox()报错信息如下:The error the code returns is as follows:WindowsError...
·
在ipython notebooks中使用Selenium打开Firefox时出错,我用的是火狐浏览器,代码如下:
from selenium import webdriver
driver = webdriver.Firefox()
报错信息如下:
The error the code returns is as follows:
WindowsError Traceback (most recent call last)
<ipython-input-7-fd567e24185f> in <module>()
----> 1 driver = webdriver.Firefox()
解决方法:
尝试初始化Firefox()时指定Firefox二进制文件,默认路径FirefoxDriver在%PROGRAMFILES%\Mozilla Firefox\firefox.exe中。指定firefoxdriver或将Firefox二进制文件的路径添加到Windows路径。指定firefoxdriver路径的代码如下:
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = FirefoxBinary('path/to/binary')
driver = webdriver.Firefox(firefox_binary=binary)
扫码关注
实用AI客栈
获取最新AI资讯与实战案例

小编微信号 : langu86
昇腾计算产业是基于昇腾系列(HUAWEI Ascend)处理器和基础软件构建的全栈 AI计算基础设施、行业应用及服务,https://devpress.csdn.net/organization/setting/general/146749包括昇腾系列处理器、系列硬件、CANN、AI计算框架、应用使能、开发工具链、管理运维工具、行业应用及服务等全产业链
更多推荐

所有评论(0)