selenium.common.exceptions.SessionNotCreatedException:消息:未创建会话:ChromeDriver的Chrome版本必须介于70到73之间 [英] selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome version must be between 70 and 73 with ChromeDriver

查看:188
本文介绍了selenium.common.exceptions.SessionNotCreatedException:消息:未创建会话:ChromeDriver的Chrome版本必须介于70到73之间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Selenium创建一个webcrawler,但是在尝试创建webdriver对象时出现此错误.

I am trying to create a webcrawler using Selenium, but I get this error when I try to create the webdriver object.

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome version must be between 70 and 73
(Driver info: chromedriver=2.45.615291 (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387),platform=Windows NT 6.1.7601 SP1 x86_64)

我下载了最新版本的 chromedriver (2.45),该版本需要Chrome 70-73.我当前的Chrome版本是68.0.3440.106(正式版本)(64位),是最新版本.我尝试下载较旧"的 Chrome版本(71),当我尝试安装它时,安装程​​序指示我已经安装了较新的版本.

I downloaded the latest version of chromedriver (2.45) which requires Chrome 70-73. My current Chrome version is 68.0.3440.106 (Official Build) (64-bit), which is the latest. I tried downloading an "older" chrome version (71) and when I tried installing it, the installer indicated that I had a newer version already installed.

似乎没有以前的Chromedriver版本可供下载,即使该网站说可以.我找不到它们.

There doesn't seem to be any previous Chromedriver releases available for download, even though the website says there is. I couldn't find them.

我不太了解71版本早于68版本吗?

I don't quite understand how version 71 is older than 68?

我是否可以使用比68更高的Chrome版本,或者可以与Chrome 68一起使用的chromedriver旧版本?

Is there a Chrome version newer than 68 actually available, or an older version of chromedriver i can use with Chrome 68?

还有其他建议吗?

这是我要执行的代码:

import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
user = 'XXXXXXX'
pwd = 'XXXXXXX'
chromedriver = "...\...\...\chromedriver.exe"
driver = webdriver.Chrome(executable_path=chromedriver) # Error occurs at this line
driver.get("http://www.facebook.com")
assert "Facebook" in driver.title
time.sleep(5) # So i can see something!
elem = driver.find_element_by_id("email")
elem.send_keys(user)
time.sleep(5) # So i can see something!
elem = driver.find_element_by_id("pass")
elem.send_keys(pwd)
time.sleep(5) # So i can see something!
elem.send_keys(Keys.RETURN)
driver.close()

推荐答案

您可以找到旧版本的chrome驱动程序

You can find the older versions of chrome driver here.

我认为从官方渠道以外的来源安装chrome并不是一个好主意,安装chrome可能会引起问题.查看Google更新服务是否正在您的PC中运行.这会自动将chrome版本更新为最新版本.我的服务器正在运行版本71.0.3578.98(正式版本)(64位).

I dont think it is a good idea to install chrome from sources other than the official channel and installation of the same can cause issues. See if the google update service is running in your PC. This will automatically update the chrome version to latest. Mine is running Version 71.0.3578.98 (Official Build) (64-bit).

这篇关于selenium.common.exceptions.SessionNotCreatedException:消息:未创建会话:ChromeDriver的Chrome版本必须介于70到73之间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆