[Python] selenium 爬虫报错:Message: 'chromedriver' executable needs to be in PATH.解决办法

强颜欢笑 提交于 2019-11-28 21:44:49

selenium 爬虫时报错:Message: 'chromedriver' executable needs to be in PATH.Please see https://sites.google.com/a/chromium.org/chromedriver/home。

报错原因:没有配置chrome浏览器的chromedriver

解决办法:

1.确定自己所用chrome的版本

打开chrome浏览器,在网址处输入chrome://version/    即可查看版本号

2.下载对应版本的chromedriver.exe

访问http://chromedriver.storage.googleapis.com/index.html,找到自己浏览器对应版本的chromedriver.exe下载

3.配置环境变量

将下载好的chromedriver.exe文件放置到chrome浏览器所在目录

复制该目录配置到Windows系统环境变量中

 打开开始菜单->我的电脑→属性→高级系统设置→环境变量→系统变量→Path→编辑→新建,将复制的目录粘贴确定即可,注意要一路确定返回

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!