导包的时候提示: raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
报错
selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
原因
Chromedriver没有加入到path。
解决办法:将Chromedriver加入到path。
步骤1. 下载chromedriver
chromedriver的下载地址: http://chromedriver.storage.googleapis.com/index.html
这里要注意:chromedriver的版本有很多,一定要下载与你电脑上chrome浏览器版本相对应的版本。
步骤2. 将chromedriver.exe复制到项目目录
重启编译器,再次运行发现未报错,说明配置已生效。
在使用Python的Selenium库时遇到了'chromedriver' executable needs to be in PATH的错误。原因是Chromedriver没有被添加到系统路径中。解决方法包括:1. 下载与Chrome浏览器版本匹配的chromedriver;2. 将chromedriver.exe复制到项目目录;3. 重启编译器。按照这些步骤操作后,问题得到解决,程序能够正常运行。
673

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



