chromdriver安装方法
- 查看谷歌浏览器的版本 ,chrome://version/;
- 在http://npm.taobao.org/mirrors/chromedriver/查找并下载相对应的chromedriver版本,我使用的google浏览器版本是78.0.3904,那么下载78.0.3904版本的即可;
- 下载完成后将chromdriver解压及复制到C:\Google\Chrome\Application以及D:\PYTHON\Scripts中;
- 将C:\Google\Chrome\Application添加到系统环境变量Path下面;
测试一下是否成功安装
from selenium import webdriver
url = 'https://baidu.com/'
driver = webdriver.Chrome(executable_path="C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe")
driver.get(url)