from selenium import webdriver
dr = webdriver.Chrome()
运行时报错:
问题分析:
1、没有下载chromedriver.exe
2、chromedriver.exe版本不对
解决方案:
1、根据Chrome的版本号,找到与之对应的Chromedriver.exe,地址https://chromedriver.storage.googleapis.com/index.html
2、添加Chromedriver.exe到系统变量中或者Python根目录下
3、代码改写:dr = webdriver.Chrome(Chromedriver.exe的路径)此方法能快速运行,建议前两种
Python ——selenium报错 'chromedriver.exe' executable needs to be in PATH
原文:https://www.cnblogs.com/mini-test/p/11228064.html