I know my question is similar to this one, but he's trying to use Chrome while I'm trying to use Firefox (47.0.1).
So basically, I'm trying to use RSelenium. Here is my code :
> library(RSelenium)
> checkForServer()
> startServer()
> mybrowser <- remoteDriver()
> mybrowser$open()
And with that last line, I get the following error.
[1] "Connecting to remote server"
Error: Summary: UnknownError
Detail: An unknown server-side error occurred while processing the command.
class: org.openqa.selenium.WebDriverException
I tried removing-reinstalling the RSelenium
package. I also tried what this answer recommends, with no result.
Thanks in advance.
Edit 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
Can you try installing from github:
devtools::install_github("ropensci/RSelenium")
Then run
RSelenium::checkForServer(update = TRUE)
then retry. Selenium recently put a beta version of Selenium 3.0 on the download tree which was unaccounted for see https://github.com/ropensci/RSelenium/issues/79. I will look to update a new version to CRAN once some additional fixes have been incorporated.
UPDATE:
There is a new version of RSelenium
on CRAN now.
install.packages("RSelenium")
library(RSelenium)
checkForServer(update = TRUE)
selServ <- startServer()
mybrowser <- remoteDriver()
mybrowser$open()
mybrowser$navigate("http://www.google.com")
mybrowser$close()
selServ$stop()
来源:https://stackoverflow.com/questions/38578885/rselenium-not-working-with-firefox