同样的错误,不一样的解决方案。selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH.

用selenium 测试经常会出现因为浏览器版本自动升级后,导致错误(selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH)。

chrome 历史版本下载:
https://www.chromedownloads.net/chrome64osx-stable/

chrome driver 历史版本下载:
http://chromedriver.storage.googleapis.com/index.html
http://npm.taobao.org/mirrors/chromedriver/

================================================================================================
然而,如果chrome和chrome driver 版本都能对上,但还是报错呢? 那你看下是不是使用了Anaconda环境,需要把chromedriver 放在对应的ENV下的/bin里(我试过放在程序目录没用).

conda ENV list
cd xxxxxx/bin

posted @ 2020-04-19 13:57  天行侠  阅读(308)  评论(0编辑  收藏  举报