使用selenium.webdriver.Chrome()時(shí)報(bào)以下錯(cuò)誤
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的包缅阳,無(wú)法下載
只能手動(dòng)下載解壓放在/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
執(zhí)行完上面命令后,啟動(dòng)爬蟲旧蛾,卻無(wú)法跳入正確頁(yè)面
報(bào)錯(cuò)如下
(Session info: chrome=56.0.2924.87)
(Driver info: chromedriver=2.8.241036,platform=Mac OS X 10.12.0 x86_64)
應(yīng)該是chrome和chromedriver的版本不兼容問(wèn)題庆杜,我換了2.24的版本后就可以正確跳到所需頁(yè)面了