Message: 'geckodriver' executable needs to be in PATH. 解决方法
问题描述:
执行如下代码
# coding=utf-8
from selenium import webdriver driver = webdriver.Firefox()
driver.maximize_window()
driver.implicitly_wait(2) driver.get('https://www.baidu.com')
try:
driver.find_element_by_id('kw')
print('test pass: ID found')
except Exception as e:
print('Exception found', format(e)) driver.quit()
提示报错:
Traceback (most recent call last):
File "E:/PythonSelenium/CSDN/004id.py", line 4, in <module>
driver = webdriver.Firefox()
File "E:\Python35\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 142, in __init__
self.service.start()
File "E:\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
原因分析:
摘取主要报错信息 Message: 'geckodriver' executable needs to be in PATH.
解决方法:
(1)测试环境:Selenium 3.4.0 Firefox 56.0 Python3.5.2
(2)下载火狐浏览器对应驱动,传送门 https://github.com/mozilla/geckodriver/releases 结合我浏览器的版本需要下载V 0.19.0
(3)解压文件获取geckodriver.exe文件,并放置在主目录下。重新运行后发现问题已解决。
注:注意火狐浏览器、Python环境变量设置。
Message: 'geckodriver' executable needs to be in PATH. 解决方法的更多相关文章
- windows下使用selenium报错selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH
问题 :执行程序代码报错: WebDriverException:Message:'geckodriver'executable needs to be in Path 或者 selenium.com ...
- selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 错误处理方法
首次使用selenium webdriver,webdriver.Firefox() 报错selenium.common.exceptions.WebDriverException: Message: ...
- selenium使用报错“selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.”
安装了python3,使用pip安装了selenium,但是在使用时,报了“selenium.common.exceptions.WebDriverException: Message: 'gecko ...
- Message: 'geckodriver' executable needs to be in PATH
1.下载geckodriver.exe:下载地址:mozilla/geckodriver请根据系统版本选择下载:(如Windows 64位系统) 2.下载解压后将getckodriver.exe复制到 ...
- 【Selenium】【BugList2】geckodriver未安装,报:WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
环境信息:Windows7 64位 + python 3.6.5 + selenium 3.11.0 +pyCharm #coding=utf-8 from selenium import webdr ...
- Go丨语言package github.com/Go-SQL-Driver/MySQL: exec: "git": executable file not found in %PATH%解决方法
Go语言在添加第三方MySQL驱动的时候报错: go: missing Git command. See https://golang.org/s/gogetcmd package github.co ...
- Path通过Selenium模拟浏览器抓取,Windows 64解决selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.方法
1.下载geckodriver.exe: 下载地址:https://github.com/mozilla/geckodriver/releases请根据系统版本选择下载:(如Windows 64位系统 ...
- WebDriverException:Message:'geckodriver'executable needs to be in Path
geckodriver是一原生态的第三方浏览器,对于selenium3.x版本都会使用geckodriver来驱动firefox,所以需要下载geckodriver.exe,下载地址:https:// ...
- selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
http://www.seleniumhq.org/download 1. selenium 3.x开始,webdriver/firefox/webdriver.py的__init__中,exec ...
随机推荐
- TCP第三次握手失败怎么办
笔试题中经常会遇到这个问题:如果tcp建立连接时第三次握手失败,tcp会做何操作?该问题的本质是判断我们对tcp的状态转换是否能有比较深刻的理解.只要理解了下面的状态转换图,很容易回答上述问题. 在此 ...
- linux系统的磁盘挂载
1.查看数据盘在没有分区和格式化数据盘之前,使用 “df –h”命令,是无法看到数据盘的,可以使用“fdisk -l”命令查看.如下图:2. 对数据盘进行分区执行“fdisk /dev/xvdb”命令 ...
- DICOMDIR
DICOMDIR 是一个可变长度 迷你 database 文件.由 group (0002, xxxx) 和 group (0004, xxxx) 为主题.描述的是一个 4 层的树状结构 (tree ...
- c#实现随鼠标移动窗体
private void MainForm_Load(object sender, EventArgs e) { //绑定事件 MouseMove += Form_MouseMove; MouseDo ...
- 关于docker的15个小tip
1. 获取最近运行容器的id 这是我们经常会用到的一个操作,按照官方示例,你可以这样做(环境ubuntu): $ ID=$(docker run ubuntu echo hello world) he ...
- Python写的简陋版一对一聊天工具,全双工
好该睡觉了,明天还要上班~~~直接上代码,后面再总结 import threading import os import socket def RecvProcess ( UDP_Socket, Lo ...
- [CALayer release]: message sent to deallocated instance iOS内存过度释放问题
[CALayer release]: message sent to deallocated instance iOS内存过度释放问题 解决方式: 1:先找到过度释放的 内存指针 开启-僵尸模式:xc ...
- Tetris
he Tetris game is one of the most popular computer games ever created. The original game was designe ...
- SqlServer聚合函数
聚合函数对一组值计算后返回单个值.除了count(统计项数)函数以外,其他的聚合函数在计算式都会忽略空值(null).所有的聚合函数均为确定性函数.即任何时候使用一组相同的输入值调用聚合函数执行后的返 ...
- ReadOnly field saved with NULL value
On CRM opportunity form view, i added readonly="1" for probability field. When i saved, wh ...