chromedriver与chrome最新版本对应表

http://npm.taobao.org/mirrors/chromedriver/

 

驱动下载最新地址

https://googlechromelabs.github.io/chrome-for-testing/#stable

 

如果配置都没错,还是报错

Message: ‘chromedriver‘ executable needs to be in PATH.

可以尝试把驱动写进代码中

原代码

from selenium import webdriver
browser = webdriver.Chrome()
browser.get('https://www.baidu.com')

 

修改为:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service

service = Service(executable_path=r'/usr/local/bin/chromedriver')
driver = webdriver.Chrome(service=service)

driver.get('https://www.baidu.com')

 

posted @ 2021-09-07 12:38  yimu-yimu  阅读(722)  评论(0编辑  收藏  举报