python selenium模块使用出错解决,Message: ‘geckodriver’ executable needs to be in PATH

错误代码如下:

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

Windows系统解决办法如下:
1、下载geckodriver.exe:
下载地址:https://github.com/mozilla/geckodriver/releases
请根据系统版本选择下载;(如Windows 64位系统)

2、下载解压后将getckodriver.exe复制到python的安装目录下,如(C:\Program Files\python),并在环境变量Path中添加路径:C:\Program Files\python;

3.重启cmd或IDLE再次运行代码即可

ubuntu16.04环境下 解决方法:
1、下载 geckodriverckod 地址: https://github.com/mozilla/geckodriver/releases
2、解压后将geckodriverckod 存放至 /usr/local/bin/ 路径下即可

posted @ 2018-04-25 11:51  阿鹏2019  阅读(786)  评论(0编辑  收藏  举报