![以上為實(shí)操代碼及報(bào)錯(cuò)過程撒强,一直顯示“selenium.common.exception.WebDriverException:Message:'chromedriver' executable needs to be in Path”
后再網(wǎng)上查找原因倦零,得到如下結(jié)果:
**這一錯(cuò)誤是因?yàn)槲业腸hrome瀏覽器沒有配置好chromedriver,怎么配置呢即供?**
1.打開chrome 輸入 “chrome://version/”來查看chrome版本 如圖定拟, 查看自己的瀏覽器版本。
2.訪問此網(wǎng)站? http://chromedriver.storage.googleapis.com/index.html? 然后選擇合適版本的driver
3.點(diǎn)擊查看具體的版本號信息逗嫡,下載符合自己版本的driver青自,因?yàn)槲业膚in是64位,這里chromedriver 只有win32位驱证,百度查看說是可以32位和64位都可以用于是下載延窜。
4. 配置如下:下載的zip文件解壓,放入python所在文件夾
? 5.這時(shí)候在運(yùn)行初始的py文件基本就可以成功了抹锄!