2016-07-25 109 views
2

我知道我的問題類似於this one,但他試圖在使用Firefox時嘗試使用Firefox(47.0.1)。RSelenium不能與火狐工作

所以基本上,我試圖使用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 
+0

你能發表'sessionInfo()'嗎? – Stedy

+0

完成,看編輯的問題。 –

+0

可能是一個java問題。你測試過R與Java通信嗎? – Stedy

回答

1

你能嘗試從GitHub安裝:

devtools::install_github("ropensci/RSelenium") 

然後運行

RSelenium::checkForServer(update = TRUE) 

然後重試。 Selenium最近在下載樹上添加了一個Selenium 3.0的測試版本,下載樹中的內容已下載,請參閱https://github.com/ropensci/RSelenium/issues/79。一旦一些額外的修補程序被合併,我會尋找更新到CRAN的新版本。

UPDATE:

還有就是RSelenium CRAN上的新版本了。

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

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

謝謝。我嘗試了github和CRAN安裝,但我仍然得到相同的錯誤。 –

+0

這裏有個類似的問題http://stackoverflow.com/questions/38812342/latest-version-of-rselenium-and-firefox/38813114?noredirect=1#comment64994382_38813114。如果你繼續有問題考慮使用Docker。有一個新的小插曲解釋其操作http://rpubs.com/johndharrison/RSelenium-Docker – jdharrison

+0

發生錯誤後,您可以運行'mybrowser $ value $ message'來獲取有關這個問題的附加信息。 – jdharrison