【python】+'chromedriver' executable needs to be in PATH



 

 

方法一:

step1:下载谷歌驱动程序:下载地址

step2:把“chromedriver.exe”复制到 谷歌浏览器(C:\Program Files\Google\Chrome\Application)python(C:\Python27)的安装目录

step3:将谷歌浏览器目录(C:\Users\HD003\AppData\Local\Google\Chrome\Application)添加到path环境变量

 

方法二:

如果方法一不行,直接使用 executable_path="C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe" 赋值

1 from selenium import webdriver
2 
3 driver = webdriver.Chrome(executable_path="C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe")
4 driver.get("http://www.baidu.com/")

 

posted @ 2019-10-21 15:10  淡怀  阅读(591)  评论(0编辑  收藏  举报