我正在尝试使用rsDriver函数运行RSelenium,但是当我运行时,出现
rD <- rsDriver()
一条消息告诉我我需要更新版本的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一起使用?
我不喜欢使用Chrome的想法,但是我无法让rsDriver使用Firefox:当我指定时browser = "firefox"
,rsDriver会给我同样的错误消息,说明ChromeDriver不支持我的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