解决 '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浏览器