chromedriver下載:
http://chromedriver.storage.googleapis.com/index.html
國內下載:
http://npm.taobao.org/mirrors/chromedriver/
首先確認你的chrome版本
點擊關於,查看具體的版本
然後在上面提到的鏈接中找到對應的版本,這裏選擇83的版本
點擊去後選擇對應的版本下載,我這裏使用的mac系統,故選擇mac的版本下載
接下來就可以使用了
webdriver.Chrome(executable_path="chromedriver")
接下來就可以使用了。
假如你在項目中使用 webdriver.Chrome(executable_path="chromedriver")來導入driver,但是有可能會提示
'chromedriver'executable needs to be in PATH
解決方法:直接把下載後解壓的文件到python的bin目錄下,即可使用
如果你不知道python的安裝目錄,可以使which python或which python3來獲取,記住python的版本要和你項目中使用的一致