2017-07-28 85 views
0

我尝试使用运行RSelenium如下:Rselenium可执行文件不存在

library("RSelenium") 
#start RSelenium server 
rD <- rsDriver(verbose = FALSE) 
remDr <- rD$client 
remDr$open() 

然而,在rsDriver(),我收到此错误:

Selenium message:The driver executable does not exist: C:\Users\kira\Documents 

Error: Summary: UnknownError 
    Detail: An unknown server-side error occurred while processing the command. 
    class: java.lang.IllegalStateException 
    Further Details: run errorDetails method 

我有下载硒的独立的罐子,把它放到路径上,但错误不会消失。任何其他解决方法?

回答

0

docs看来,您应该从命令终端启动服务器。当然,您可以使用system2命令从R执行此操作,但可能更容易从终端启动jar以进行调试。

Alternatively you can run the binary manually. Open a console in your OS and navigate to where the binary is located and run:

java -jar selenium-server-standalone-x.xx.x.jar

By default the Selenium Server listens for connections on port 4444.

Note for Mac OSX: The default port 4444 is sometimes used by other programs such as kerberos. In our examples we use port 4445 in respect of this and for cdonsistency with the Docker vignette.

之后,来自R连接:

remDr <- remoteDriver(remoteServerAddr = "localhost" 
         , port = 4444L 
         , browserName = "firefox" 
        ) 

remDr$open() 

remDr$getStatus() 
+0

谢谢你,我运行可执行的JAR从CMD我会尝试端口4444,但到现在为止我跑Rselenium,而不需要先运行可执行 – Sasak

+0

你”再右边,'rsDriver'是一个我不熟悉的包装。你可以打开'verbose = TRUE'并包含输出,所以我们可以更详细地了解发生了什么? – cole