python+selenium 火狐浏览器运行不行

 我来答
从空去听8
2017-11-13 · TA获得超过7438个赞
知道大有可为答主
回答量:6907
采纳率:93%
帮助的人:5457万
展开全部
python+selenium 火狐浏览器运行不行?
Traceback (most recent call last):
File "D:\Program Files\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 64, in start
stdout=self.log_file, stderr=self.log_file)
File "D:\Program Files\Python35\lib\subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "D:\Program Files\Python35\lib\subprocess.py", line 1224, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\workspace\Test\selenium_study\worm_1_1.py", line 7, in <module>
browser = webdriver.Firefox()
File "D:\Program Files\Python35\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 135, in __init__
self.service.start()
File "D:\Program Files\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 71, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x0000000000A44160>>
Traceback (most recent call last):
File "D:\Program Files\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 163, in __del__
self.stop()
File "D:\Program Files\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 135, in stop
if self.process is None:
AttributeError: 'Service' object has no attribute 'process'?
现在版本的firefox浏览器,需要下载一个geckodriver驱动放到你的python文件夹里面.
系莲示清馨
2019-08-16 · TA获得超过3651个赞
知道大有可为答主
回答量:3143
采纳率:30%
帮助的人:207万
展开全部
python的配置参数是不是正确
seleninm在新版火狐下可能会有些问题,建议退回至49及以下版本安装使用。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式