安装selenium
1 | pip install selenium |
测试使用chrome打开百度
1 | from selenium import webdriver |
报错
1 | selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 75 |
解决错误
报错原因是chromedriver.exe版本的问题,首先查看当前系统chrome的版本,然后下载对应的驱动就可以了
我这里使用的虚拟环境,因此将下载的驱动放到如下目录
