【问题标题】:Latest version of RSelenium and Firefox最新版本的 RSelenium 和 Firefox
【发布时间】:2016-08-07 08:30:50
【问题描述】:

当我尝试打开 RSelenium 时收到此错误

[1] "Connecting to remote server"
Error:   Summary: UnknownError
     Detail: An unknown server-side error occurred while processing the command.
     class: org.openqa.selenium.firefox.NotConnectedException

我的火狐版本是

Firefox version: 480b10

根据this我尝试更新服务器版本

library("RSelenium")
startServer()
unlink(system.file("bin", package = "RSelenium"), recursive = T)
checkForServer(update = TRUE)
remDr <- remoteDriver()
Sys.sleep(5)
remDr$open()
Sys.sleep(5)

但问题依然存在。有人遇到这个问题吗?任何可能的解决方案?

【问题讨论】:

标签: r selenium firefox rselenium


【解决方案1】:

从 Firefox 48 开始,将需要壁虎驱动程序/木偶来运行带有 Selenium 的 Firefox。

如果您有 Firefox 48,您可以按如下方式运行 gecko 驱动程序:

参考指南

  1. https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver
  2. https://github.com/mozilla/geckodriver/releases下载相关的gecko驱动
  3. 将其添加到您的 PATH 或在启动二进制文件时引用该位置(见下文)
# get beta selenium standalone

RSelenium::checkForServer(beta = TRUE)
# assume gecko driver is not in our path (assume windows and we downloaded to docs folder)
# if the driver is in your PATH the javaargs call is not needed
selServ <- RSelenium::startServer(javaargs = c("-Dwebdriver.gecko.driver=\"C:/Users/john/Documents/geckodriver.exe\""))
remDr <- remoteDriver(extraCapabilities = list(marionette = TRUE))
remDr$open()
....
....
remDr$close()
selServ$stop()  

以上目前需要RSelenium的开发版。或者,您可以从 http://selenium-release.storage.googleapis.com/index.html 下载 Selenium 二进制文件。选择当前与 Firefox 48 一起运行的 3.0 beta 2 二进制文件。运行二进制文件

java -Dwebdriver.gecko.driver=C:/Users/john/Documents/geckodriver.exe -jar selenium-server-standalone-3.0.0-beta2.jar

【讨论】:

  • 谢谢。这似乎合乎逻辑,但是当我去测试你的答案时,我在RSelenium::checkForServer(beta = TRUE) : unused argument (beta = TRUE) 中收到此错误错误
  • @Jake 你需要安装RSelenium 的开发版。 devtools::install_github("ropensci/Rselenium") 。或者,您可以手动启动服务器,我对此添加了注释。
猜你喜欢
  • 2018-11-22
  • 1970-01-01
  • 2018-10-15
  • 1970-01-01
  • 2023-04-09
  • 2018-05-05
  • 2019-06-29
  • 1970-01-01
  • 2015-09-16
相关资源
最近更新 更多