Message: ‘chromedriver’ executable needs to be in PATH.
1、下载本机谷歌浏览器对应版本的驱动并下载https://chromedriver.storage.googleapis.com/index.html
2、将chromedriver.exe放到合适位置,如下选一:
2.1如果使用anaconda的环境,则把chromedriver.exe放置到anaconda3\envs\环境\Scripts下
2.2如果使用本地python环境,将chromedriver.exe放到python的安装目录下
2.3如果想将chromedriver.exe放到指定位置,则在调用句柄时候指定放置其位置后加chromedriver:
driver = webdriver.Chrome(r’D:/所放置文件夹/chromedriver’)