爬虫开发过程中使用selenium +webdriver打开chrome,说一下chrome dirver的安装

1、我的chrome版本65.0.3325.181
打开如下页面:
https://sites.google.com/a/chromium.org/chromedriver/downloads
对照下载说明,找到对应的ChromeDriver版本 2.38
chromedriver安装

2、打开如下网页:
http://chromedriver.storage.googleapis.com/index.html
chromedriver安装

选取2.38文件夹,下载

chromedriver安装

3、解压缩

把exe文件放置到如下位置之一:

(1)将解压后的exe文件放到chrome的安装目录下 (eg:C:\Program Files (x86)\Google\Chrome\Application)
(2)直接放到Python的安装目录下 (eg:D:\tools\Python3.5.3)

4、配置环境变量

对变量Path进行编辑,在变量值后面加入chrome或Python的安装目录


5、用 Chrome 浏览器来测试


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





相关文章:

  • 2022-12-23
  • 2021-08-19
  • 2021-07-20
  • 2021-11-18
  • 2021-04-30
  • 2022-02-09
  • 2021-11-17
猜你喜欢
  • 2022-12-23
  • 2021-09-07
  • 2021-06-01
  • 2021-10-01
  • 2022-02-09
  • 2022-02-13
  • 2022-12-23
相关资源
相似解决方案