1、下载谷歌驱动:chromedriver.exe
http://chromedriver.storage.googleapis.com/index.html (下载驱动的链接)
2、把下载的chromedriver.exe 放到 C:\Programs\Python\Python36 这个下面
(注意:把这个目录添加到环境变量中,如果有python的环境变量了就可以不用添加了,因为他们是同一个路径)
3、代码测试
from selenium import webdriver at = webdriver.Chrome() diver = at.get('https://www.baidu.com/')
备注:
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument
(Session info: chrome=79.0.3945.79)
# 这个问题不是版本对不上,仅仅是因为url没有写协议名称