chromedriver.exe,自动化测试web,安装谷歌驱动,和自己遇到的问题

1、下载谷歌驱动:chromedriver.exe

   http://chromedriver.storage.googleapis.com/index.html (下载驱动的链接)

  

 

2、把下载的chromedriver.exe 放到 C:\Programs\Python\Python36 这个下面

 

(注意:把这个目录添加到环境变量中,如果有python的环境变量了就可以不用添加了,因为他们是同一个路径)

代码演示

from selenium import webdriver

db=webdriver.Chrome()
db.get("http://www.baidu.com")

3、自己也遇到了一个问题  selenium.common.exceptions.InvalidArgumentException: Message: invalid argument(Session info: chrome=87.0.4280.88) 

找了好半天  以为是版本的问题   加上请求头协议就可以了

 

posted @ 2020-12-18 11:54  晟森正茂时  阅读(324)  评论(0编辑  收藏  举报