试了把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‘)
解决 'chromedriver' executable needs to be in PATH.'报错
时间: 2024-11-05 15:59:49