前言
在使用selenium的时候,新手一般会遇到这样的问题,代码如下:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://www.amazon.com')
运行这段代码,会出现下面的bug
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
解决方法
1. 首先我们使用谷歌浏览器,输入如下命令,并按回车
chrome://version/
这样做,是为了查看谷歌浏览器的版本