解决 'chromedriver' executable needs to be in PATH.'报错

试了把chromedriver.exe放到chrome安装文件下,python安装文件下,然后把路径配到path里,均无用。

最后是修改函数调用得以解决:

from selenium import  webdriver

browser = webdriver.Chrome(executable_path = 'C:\Program Files (x86)\Google\Chrome\Application\chromedriver_X64.exe')
browser.get('http://www.baidu.com')

executable_path指定了chromedriver所在的路径,程序运行时就会到该路径下启动chrome浏览器
posted @ 2017-11-30 16:21  Claire_xu  阅读(29426)  评论(0编辑  收藏  举报