美文网首页我爱编程
使用selenium时遇到问题总结

使用selenium时遇到问题总结

作者: 又不行了 | 来源:发表于2017-03-31 09:58 被阅读0次

使用selenium.webdriver.Chrome()时报以下错误

selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

pip和brew都找不到chromedriver的包,无法下载

只能手动下载解压放在/usr/local/bin目录下

下载地址:http://chromedriver.storage.googleapis.com/index.html

命令行如下

$ unzip chromedriver_map32.zip

$ mv chromedriver /usr/local/bin

$ cd /usr/local/bin

$ chmod a+x chromedirver

执行完上面命令后,启动爬虫,却无法跳入正确页面

报错如下

(Session info: chrome=56.0.2924.87)

(Driver info: chromedriver=2.8.241036,platform=Mac OS X 10.12.0 x86_64)

应该是chrome和chromedriver的版本不兼容问题,我换了2.24的版本后就可以正确跳到所需页面了

相关文章

网友评论

    本文标题:使用selenium时遇到问题总结

    本文链接:https://www.haomeiwen.com/subject/isdhnttx.html