查看你的Chrome浏览器版本
然后去这个网站下载对应版本的Chromedriver
https://chromedriver.storage.googleapis.com/index.html
对应好版本就可以正常使用Selenium进行自动化测试或者爬虫了
在python中的初始代码为
from selenium import webdriver
chrome_driver_path = 'path/to/chromedriver.exe' # Chrome驱动程序的路径
driver = webdriver.Chrome(executable_path=chrome_driver_path)
其它 :下载WebDriver
-
Chrome浏览器驱动下载地址:https://chromedriver.storage.googleapis.com/index.html
-
Edge浏览器驱动下载地址:https://developer.microsoft.com/zh-cn/microsoft-edge/tools/webdriver) 或 https://msedgewebdriverstorage.z22.web.core.windows.net
-
Mozilla浏览器驱动下载地址:https://github.com/mozilla/geckodriver/tags
-
Opera浏览器驱动下载地址:https://github.com/operasoftware/operachromiumdriver/tags
-
Safari浏览器驱动下载地址:https://webkit.org/blog/6900/webdriver-support-in-safari-10