【问题标题】:RSelenium not working with FirefoxRSelenium 不适用于 Firefox
【发布时间】:2016-07-25 23:28:33
【问题描述】:

我知道我的问题与this one 类似,但他尝试使用 Chrome,而我尝试使用 Firefox (47.0.1)。

所以基本上,我正在尝试使用 RSelenium。这是我的代码:

> library(RSelenium)
> checkForServer()

> startServer()
> mybrowser <- remoteDriver()
> mybrowser$open()

最后一行,我收到以下错误。

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

我尝试删除并重新安装 RSelenium 包。我也试过this answer推荐的,没有结果。

提前致谢。


编辑 1:

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252    LC_MONETARY=French_France.1252 LC_NUMERIC=C                  
[5] LC_TIME=French_France.1252    

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

other attached packages:
[1] RSelenium_1.3.5 RJSONIO_1.3-0   RCurl_1.95-4.8  bitops_1.0-6    foreach_1.4.3   httr_1.2.0      XML_3.98-1.4   

loaded via a namespace (and not attached):
[1] R6_2.1.2         tools_3.2.3      codetools_0.2-14 iterators_1.0.8  caTools_1.17.1  

【问题讨论】:

  • 你能发帖sessionInfo()吗?
  • 完成,请参阅已编辑的问题。
  • 可能是 java 问题。您是否测试过 R 与 Java 通信?
  • 我该如何测试?
  • 你能加载rJava包吗?我注意到虽然 RSelenium 没有明确使用它,但它可以是测试 R 和 Java 之间连接的好方法,尤其是在 Windows 上

标签: r firefox selenium-firefoxdriver rselenium


【解决方案1】:

你可以尝试从 github 安装吗:

devtools::install_github("ropensci/RSelenium")

然后运行

RSelenium::checkForServer(update = TRUE)

然后重试。 Selenium 最近在下载树上放置了 Selenium 3.0 的 beta 版本,该版本下落不明,请参阅 https://github.com/ropensci/RSelenium/issues/79。一旦合并了一些额外的修复程序,我将寻求更新 CRAN 的新版本。

更新:

现在 CRAN 上有一个新版本的RSelenium

install.packages("RSelenium")
library(RSelenium)
checkForServer(update = TRUE)

selServ <- startServer()
mybrowser <- remoteDriver()
mybrowser$open()
mybrowser$navigate("http://www.google.com")
mybrowser$close()
selServ$stop()

【讨论】:

  • 谢谢。我尝试了 github 和 CRAN 安装,但我仍然得到同样的错误。
  • 这里有一个类似的问题stackoverflow.com/questions/38812342/…。如果您仍然遇到问题,请考虑使用 Docker。有一个新的小插曲解释了它的操作rpubs.com/johndharrison/RSelenium-Docker
  • 发生错误后,您可以运行mybrowser$value$message 以获取有关问题可能的附加信息。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-08-22
  • 2017-08-11
  • 2017-01-16
  • 2019-01-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多