使用Selenium打开chrome时出现错误,打开后立即打开并关闭窗口。这是我的代码:
import requests
import json
from selenium import webdriver
driver = webdriver.Chrome(executable_path=r'C:\Users\Salvatore\Desktop\Desktop\webdrivers\chromedriver.exe')```
This is the error:
```selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81```
答案 0 :(得分:1)
请检查您使用的是哪种chrome浏览器,应根据chrome浏览器版本使用chrome驱动程序exe(错误似乎是您使用的Chrome驱动程序版本为81,但您的chrome浏览器版本不超过81,例如83,84)>
https://chromedriver.chromium.org,您可以在此处下载最新的chrome驱动程序版本
答案 1 :(得分:0)
您可以通过以下方法检查您当前的Chrome版本:Chrome->选项->关于Chrome,然后您将知道需要下载哪个版本的chromedriver.exe
答案 2 :(得分:0)
您的 ChromeDriver 版本必须基于 Chrome浏览器版本