为什么在删除LICENSE.chromedriver文件后,R中的RSelenium中的rsDriver仍然有错误?

y1aodyip  于 2023-01-22  发布在  其他
关注(0)|答案(1)|浏览(242)

尊敬的会员,我正在使用RSelenium,在使用rsDriver时收到以下错误消息:

> rD <- rsDriver(port=free_port(random=TRUE),browser="chrome",chromever="109.0.5414.25",verbose=FALSE)
Could not open chrome browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to localhost port 795: Connection refused
Check server log for further details.
Warning message:
In rsDriver(port = free_port(random = TRUE), browser = "chrome",  :
  Could not determine server status.

我已经成功地删除了LICENSE.chromedriver文件,这里提到:https://github.com/ropensci/wdman/issues/31
但是我没有 Boot ...请帮帮我...
selenium 的输出(retcommand =T)

> library(wdman)
> selenium(retcommand = T)
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] "C:\\PROGRA~1\\COMMON~1\\Oracle\\Java\\javapath\\java.exe -Dwebdriver.chrome.driver=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_chromedriver\\win32\\110.0.5481.30/chromedriver.exe\" -Dwebdriver.gecko.driver=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_geckodriver\\win64\\0.32.0/geckodriver.exe\" -Dphantomjs.binary.path=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_phantomjs\\windows\\2.1.1/phantomjs-2.1.1-windows/bin/phantomjs.exe\" -jar \"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_seleniumserver\\generic\\4.0.0-alpha-2/selenium-server-standalone-4.0.0-alpha-2.jar\" -port 4567"

更改chromever =““110.0.5481.30”后的错误消息:

>  rD <- rsDriver(port=free_port(random=TRUE),browser="chrome",chromever="110.0.5481.30",verbose=FALSE)

Selenium message:session not created: This version of ChromeDriver only supports Chrome version 110
Current browser version is 109.0.5414.75 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
Build info: version: '4.0.0-alpha-2', revision: 'f148142cf8', time: '2019-07-01T21:30:10'
System info: host: 'EC2AMAZ-1JRGETJ', ip: '172.31.9.48', os.name: 'Windows Server 2016', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.1'
Driver info: driver.version: unknown
remote stacktrace: Backtrace:
    (No symbol) [0x00C53643]
    (No symbol) [0x00BE8981]
    (No symbol) [0x00AEB35D]
    (No symbol) [0x00B0ED2D]
    (No symbol) [0x00B09B50]
    (No symbol) [0x00B06F89]
    (No symbol) [0x00B41EB5]
    (No symbol) [0x00B41B0C]
    (No symbol) [0x00B3B1F6]
    (No symbol) [0x00B10D57]
    (No symbol) [0x00B124FD]
    GetHandleVerifier [0x00ECB5F2+2513186]
    GetHandleVerifier [0x00EFB730+2710112]
    GetHandleVerifier [0x00EFECDC+2723852]
    GetHandleVerifier [0x00D02250+640384]
    (No symbol) [0x00BF1142]
    (No symbol) [0x00BF6AD8]
    (No symbol) [0x00BF6BBB]
    (No symbol) [0x00C009FB]
    BaseThreadInitThunk [0x768262C4+36]
    RtlSubscribeWnfStateChangeNotification [0x76F31B69+1081]
    RtlSubscribeWnfStateChangeNotification [0x76F31B34+1028]

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.

binman的输出::list_versions(“chromever”)

> library(binman)
> list_versions("chromedriver")
$win32
 [1] "100.0.4896.20" "100.0.4896.60" "101.0.4951.15" "101.0.4951.41" "102.0.5005.27"
 [6] "102.0.5005.61" "103.0.5060.24" "103.0.5060.53" "104.0.5112.20" "104.0.5112.29"
[11] "106.0.5249.61" "107.0.5304.18" "107.0.5304.62" "108.0.5359.22" "108.0.5359.71"
[16] "109.0.5414.25" "109.0.5414.74" "110.0.5481.30" "96.0.4664.45"  "97.0.4692.20" 
[21] "97.0.4692.36"  "97.0.4692.71"  "98.0.4758.48"  "98.0.4758.80"  "99.0.4844.17" 
[26] "99.0.4844.35"  "99.0.4844.51"

但我的 chrome 版本是:

Chrome is up to date
Version 109.0.5414.75 (Official Build) (64-bit)

来自 selenium 的输出(返回命令= T,色度转换器=“109.0.5414.25”)

> selenium(retcommand = T,chromever = "109.0.5414.25")
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] "C:\\PROGRA~1\\COMMON~1\\Oracle\\Java\\javapath\\java.exe c(\"-Dwebdriver.chrome.driver=\\\"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\binman\\\\binman_chromedriver\\\\win32\\\\109.0.5414.25/chromedriver.exe\\\"\", \"-Dwebdriver.chrome.driver=\\\"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\binman\\\\binman_chromedriver\\\\win32\\\\109.0.5414.25/LICENSE.chromedriver\\\"\") -Dwebdriver.gecko.driver=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_geckodriver\\win64\\0.32.0/geckodriver.exe\" -Dphantomjs.binary.path=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_phantomjs\\windows\\2.1.1/phantomjs-2.1.1-windows/bin/phantomjs.exe\" -jar \"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_seleniumserver\\generic\\4.0.0-alpha-2/selenium-server-standalone-4.0.0-alpha-2.jar\" -port 4567
kuuvgm7e

kuuvgm7e1#

更新:通过确保删除了正确Chromever的LICENSE文件,问题得到了解决,在这种情况下,原帖删除了不同版本Chromedriver的LICENSE.Chromever。
binman/wdman将为每个驱动程序的每个版本下载并创建一个新文件夹。这意味着,如果您指定要使用的chromedriver版本,则只会遇到一次此问题。另一方面,binman/wdman采用最新chromever的默认行为意味着,即使您没有在RSelenium中使用chrome浏览器,新chrome驱动程序的发布也可能会破坏您的代码
运行selenium(retcommand = T)会告诉你RSelenium是如何试图找到你的chromedriver的。你可以查看输出来找到chromedriver的文件路径。要寻找的最大标志是retcommand输出中的R风格“c()”向量。如果发生这种情况,你必须删除LICENSE.chromedriver文件
来自AKshayKulkarni的示例

library(wdman)
selenium(retcommand = T,chromever = '109.0.5414.25')

请注意,在java.exe之后,R向量以“c(”开头,这意味着需要删除该文件夹中的LICENSE.chromedriver。

[1] "C:\\PROGRA~1\\COMMON~1\\Oracle\\Java\\javapath\\java.exe c(\"-Dwebdriver.chrome.driver=\\\"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\binman\\\\binman_chromedriver\\\\win32\\\\109.0.5414.25/chromedriver.exe\\\"\", \"-Dwebdriver.chrome.driver=\\\"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\binman\\\\binman_chromedriver\\\\win32\\\\109.0.5414.25/LICENSE.chromedriver\\\"\") -Dwebdriver.gecko.driver=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_geckodriver\\win64\\0.32.0/geckodriver.exe\" -Dphantomjs.binary.path=\"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_phantomjs\\windows\\2.1.1/phantomjs-2.1.1-windows/bin/phantomjs.exe\" -jar \"C:\\Users\\Administrator\\AppData\\Local\\binman\\binman_seleniumserver\\generic\\4.0.0-alpha-2/selenium-server-standalone-4.0.0-alpha-2.jar\" -port 4567

原答复:
你能不能跑

library(wdman)
selenium(retcommand = T)

然后公布结果吗

相关问题