会话未创建:此版本的 ChromeDriver 仅支持使用 Selenium 的 ChromeDriver Chrome 的 Chrome 版本 74 错误 [英] session not created: This version of ChromeDriver only supports Chrome version 74 error with ChromeDriver Chrome using Selenium

查看:32
本文介绍了会话未创建:此版本的 ChromeDriver 仅支持使用 Selenium 的 ChromeDriver Chrome 的 Chrome 版本 74 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 rsDriver 函数运行 RSelenium,但是当我运行时rD <- rsDriver()我收到一条消息,告诉我我需要更新版本的 Chrome:

I'm trying to run RSelenium using the rsDriver function, but when I run rD <- rsDriver() I get a message telling me I need a newer version of Chrome:

> rD <- rsDriver()
checking Selenium Server versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking chromedriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking geckodriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking phantomjs versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
[1] "Connecting to remote server"

Selenium message:session not created: This version of ChromeDriver only supports Chrome version 74
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Mac OS X 10.14.3 x86_64)

Could not open chrome browser.
Client error message:
     Summary: SessionNotCreatedException
     Detail: A new session could not be created.
     Further Details: run errorDetails method
Check server log for further details.

错误消息似乎说我需要 Chrome 版本 74.0.3729.6,但是当我查看 Chrome 的设置时,它告诉我我正在运行最新的稳定版本 (73.0.3683.75).进一步谷歌搜索后,74.0.3729.6 是 Chrome 的预发布开发版本:我是否需要安装它才能将 ChromeDriver 与 RSelenium 一起使用?

The error message appears to say that I need Chrome version 74.0.3729.6, but when I look in Chrome's settings, it tells me that I'm running the latest stable version (73.0.3683.75). Upon further googling, 74.0.3729.6 is a pre-release dev version of Chrome: do I need to install this in order to use ChromeDriver with RSelenium?

我不接受使用 Chrome 的想法,但我无法让 rsDriver 使用 Firefox:当我指定 browser = "firefox" 时,rsDriver 给了我相同的关于 ChromeDriver 不支持我的 Chrome 版本的错误消息.

I'm not wedded to the idea of using Chrome, but I haven't been able to get rsDriver to use Firefox: when I specify browser = "firefox", rsDriver gives me the same error message about ChromeDriver not supporting my version of Chrome.

我的会话信息是:

R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.3

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] wdman_0.2.4     forcats_0.3.0   stringr_1.3.1   dplyr_0.7.8     purrr_0.2.5     readr_1.3.1     tidyr_0.8.2    
 [8] tibble_2.0.1    ggplot2_3.1.0   tidyverse_1.2.1 rvest_0.3.2     xml2_1.2.0      RSelenium_1.7.5

推荐答案

我今天遇到了同样的问题,并从 Google 找到了这篇文章和其他文章.我想我可能有一个更直接的解决方案来修改你的代码.先前的答案在识别版本不匹配方面是正确的.

I encountered the same issue today and found this post and others from Google. I think I may have a more direct solution as a modification of your code. The previous answer is correct in identifying the mismatch in versions.

我尝试了建议的解决方案无济于事.我发现我的电脑上的版本是正确的.然而,这个不匹配错误并不是由计算机上安装的实际版本造成的,而是 RSelenium 代码在默认参数下寻找最新"版本的 Chrome/ChromeDriver.有关参数,请参阅 ?rsDriver() 帮助页面.

I tried the proposed solutions to no avail. I found that the versions were correct on my computer. However, this mismatch error was not resulting from the actual versions installed on the computer, but rather the RSelenium code is seeking the "latest" version of Chrome/ChromeDriver by default argument. See ?rsDriver() help page for the arguments.

如果您按照帮助文档中的说明运行代码binman::list_versions("chromedriver"),那么您可以识别与该功能兼容的版本.就我而言,我能够使用以下代码建立连接.

If you run the code binman::list_versions("chromedriver") as specified in the help documentation, then you can identify the versions of compatible with the function. In my case, I was able to use the following code to establish a connection.

driver <- rsDriver(browser=c("chrome"), chromever="73.0.3683.68", extraCapabilities = eCaps)

您应该能够使用 chromever= 参数指定您的 Chrome 版本.不过,我不得不使用最接近的版本(我的 chrome 版本是73.0.3683.75").

You should be able to specify your version of Chrome with the chromever= argument. I had to use the closest version, though (my chrome version was "73.0.3683.75").

希望这有帮助!

这篇关于会话未创建:此版本的 ChromeDriver 仅支持使用 Selenium 的 ChromeDriver Chrome 的 Chrome 版本 74 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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