报错信息如下:
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
解决:
下载chromedriver,放在指定路径下,并将路径添加至path环境变量(属性 -- 高级系统设置 -- 高级 -- 环境变量)
下载地址:https://sites.google.com/a/chromium.org/chromedriver/downloads
PS:注意查看自己的chrome版本号,需要下载跟chrome版本一致的chromedriver
否则会报错:selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version XX