当我尝试打开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版本是
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)
但问题仍然存在。有人面对这个问题吗?任何可能的解决方案?
答案 0 :(得分:2)
从Firefox 48开始,需要使用Gecko驱动程序/牵线木偶来运行带有Selenium的Firefox。
如果你有Firefox 48,你可以按如下方式运行gecko驱动程序:
参阅指南
# 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