Python ——selenium报错 'chromedriver.exe' executable needs to be in PATH

from  selenium import webdriver

dr = webdriver.Chrome()

 运行时报错:

  

 问题分析:

  1、没有下载chromedriver.exe

  2、chromedriver.exe版本不对

 解决方案:

  根据Chrome的版本号,找到与之对应的Chromedriver.exe,地址https://chromedriver.storage.googleapis.com/index.html

  1、添加Chromedriver.exe到系统变量中或者Python根目录下

  2、代码改写:dr = webdriver.Chrome(Chromedriver.exe的路径)

原文地址:https://www.cnblogs.com/mini-test/p/11228064.html