session not created: This version of ChromeDriver

2019-08-23 00:35发布

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.

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?

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.

My session info is:

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

15条回答
干净又极端
2楼-- · 2019-08-23 00:59

This solution worked for me

  1. Make sure you're using R 3.5.3 or greater
  2. driver <- rsDriver(browser=c("chrome"), chromever="73.0.3683.68")
查看更多
放我归山
3楼-- · 2019-08-23 01:03

I was really struggling with this mismatch between ChromeDriver v74.0.3729.6 and the Chrome Browser v73.0. I finally found a way to get ChromeDriver to an earlier version,

  1. In Chrome > About Google Chrome, copy the the version number, except for the last group. For instance, 72.0.3626.

  2. Paste that version at the end of this url and visit it. It will come back with a version, which you should copy. https://chromedriver.storage.googleapis.com/LATEST_RELEASE_

  3. Back in the command line, run bundle exec chromedriver-update <copied version>

查看更多
疯言疯语
4楼-- · 2019-08-23 01:03

Updating the Google Chrome version to 74 worked for me.

Steps: 1. Go to Help -> About Google Chrome -> Chrome will automatically look for updates(update Chrome to the latest version)

enter image description here

查看更多
beautiful°
5楼-- · 2019-08-23 01:03

For MacOS chromedriver upgrade did the trick:

brew cask upgrade chromedriver
查看更多
你好瞎i
6楼-- · 2019-08-23 01:03

It is useful for Linux people. My problem was trivial, I used chromium-browser. I installed chrome and all problems were resolved. It could work with chromium but with extra actions. I did not receive a success. I could set a need driver version to protractor configuration. It used the latest. I needed a downgrade.

查看更多
狗以群分
7楼-- · 2019-08-23 01:06

There's no need to downgrade Chrome anymore, when you get this error only means it's time to run webdriver-manager update again

查看更多
登录 后发表回答