您的位置:首页 > 其它

selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PAT

2019-03-02 14:43 1091 查看

selenium使用Chrome时报错:

selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

1、进入页面

https://sites.google.com/a/chromium.org/chromedriver/home

2、选择合适的Chrome版本下载



3、解压下的Chromedriver放到python安装的目录下,

4、运行测试

from selenium import webdriver # 从selenium导入webdriver

driver = webdriver.Chrome()  # Optional argument, if not specified will search path.
driver.get('https://www.baidu.com') # 获取百度页面

可以了,之前测试了好几次,安装其他目录加到环境变量还是不行,后来放到python安装目录下就好了。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐