刚刚开始学习Python爬虫,在 Python 下引用 Selenium 包开发时, WebDriver甩出了一个错误消息然后就中断了,错误消息:
WebDriverException: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
在环境变量中配置PATH,不成功,在网上搜索了很多解决方法都没有效果,只能手动#手动添加路径,最终解决方案:
1)查看下载的chrome浏览器版本
方法:在chrome浏览器中打开:chrome://version

2)找到相应版本的chromedriver
- 官方网站:https://sites.google.com/a/chromium.org/chromedriver
- 下载地址:https://chromedriver.storage.googleapis.com/index.html
打开官方网站,查看相应的

在使用Python的Selenium库时遇到'chromedriver executable needs to be in path'错误。通过查看Chrome浏览器版本,下载对应版本的chromedriver,将其放在指定路径并手动配置,最终成功运行代码。
最低0.47元/天 解锁文章
655

被折叠的 条评论
为什么被折叠?



