windows下chromedriver的安装

旧街凉风 提交于 2019-12-02 12:41:28

chromdriver安装方法

  1. 查看谷歌浏览器的版本chrome://version/
  2. http://npm.taobao.org/mirrors/chromedriver/查找并下载相对应的chromedriver版本,我使用的google浏览器版本是78.0.3904,那么下载78.0.3904版本的即可;
    在这里插入图片描述
    在这里插入图片描述
  3. 下载完成后将chromdriver解压及复制到C:\Google\Chrome\Application以及D:\PYTHON\Scripts中;
  4. 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)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!