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 ...
随机推荐
- win7 64位搭建scrapy(转)
win7 64位系统依赖的scrapy文件链接:http://pan.baidu.com/s/1mgJS7BM 一个很好的python 64位包下载页面:http://www.lfd.uci.edu/ ...
- combogrid翻页后保持显示内容为配置的textField解决办法
easyui的combogrid当配置pagination为true进行分页时,当datagrid加载其他数据页,和上一次选中的valueField不匹配时,会导致combogrid直接显示value ...
- c++学习之多态(虚函数和纯虚函数)
c++是面向对象语言,面向对象有个重要特点,就是继承和多态.继承之前学过了,就是一种重用类的设计方式.原有的类叫父类,或者基类,继承父类的类叫子类.在设计模式中,我们总是要避免继承,推荐用组合.因为继 ...
- css3新单位vw、vh、vmin、vmax的使用介绍
1,vw.vh.vmin.vmax 的含义 (1)vw.vh.vmin.vmax 是一种视窗单位,也是相对单位.它相对的不是父节点或者页面的根节点.而是由视窗(Viewport)大小来决定的,单位 1 ...
- java笔试题(5)
1.Comparable和Comparator接口是干什么的?列出它们的区别. Java提供了只包含一个compareTo()方法的Comparable接口.这个方法可以个给两个对象排序.具体来说,它 ...
- python 相似语句匹配(非机器学习)
#coding=utf-8 import xlrd import distance from sklearn.feature_extraction.text import CountVectorize ...
- [Functional Programming] Pointy Functor Factory
A pointed functor is a functor with an of method class IO { // The value we take for IO is always a ...
- HTTP协议响应消息的常用状态码【转】
“100″ : Continue(继续) 初始的请求已经接受,客户应当继续发送请求的其余部分.(HTTP 1.1新) “101″ : Switching Protocols(切换协议) 请求者已要求服 ...
- RaceWeb介绍(7):由500强公司数据高速生成百度地图——生成坐标字段及坐标数据
接上篇. 一.生成X坐标.Y坐标两个字段. 我们须要为每一个公司建立X坐标和Y坐标字段,用来保存XY坐标. 既然为了突出"快",这一步就有程序来完毕吧. 右键单击"世界5 ...
- apple iMac一体机 装双系统 实战! (Apple +Win 7 64bit)
http://group.zol.com.cn/1/641_485.html http://tieba.baidu.com/p/2532811864 http://www.jb51.net/os/82 ...