RSelenium无法连接到firefox和chrome配置文件

时间:2017-03-16 14:43:13

标签: r selenium rselenium

我为chrome运行这个:

library(RSelenium)
rD <- rsDriver(verbose = FALSE)

或者这对于firefox:

library(RSelenium)
rD <- rsDriver(browser = c('firefox'))

我接受了这个错误: 对于铬:

Error in checkError(res) : 
  Couldnt connect to host on http://localhost:4567/wd/hub.
  Please ensure a Selenium server is running.
In addition: Warning message:
In rsDriver(verbose = FALSE) : Could not determine server status.

for firefox:

checking Selenium Server versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking chromedriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking geckodriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking phantomjs versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
[1] "Connecting to remote server"
Error in checkError(res) : 
  Couldnt connect to host on http://localhost:4567/wd/hub.
  Please ensure a Selenium server is running.
In addition: Warning message:
In rsDriver(browser = c("firefox")) : Could not determine server status.

我试图找到解决方法,因此我使用了this帖子中的代码:

library(wdman)
> selServ <- wdman::selenium(verbose = FALSE)
> selServ$log()
$stderr
[1] "Error: Invalid or corrupt jarfile C:\\Users\\iris\\AppData\\Local\\binman\\binman_seleniumserver\\generic\\3.3.1/selenium-server-standalone-3.3.1.jar"

$stdout
character(0)

> selServ <- wdman::selenium(retcommand = TRUE, verbose = FALSE)
> cat(selServ)
C:\PROGRA~3\Oracle\Java\javapath\java.exe -Dwebdriver.chrome.driver="C:\Users\iris\AppData\Local\binman\binman_chromedriver\win32\2.28/chromedriver.exe" -Dwebdriver.gecko.driver="C:\Users\iris\AppData\Local\binman\binman_geckodriver\win64\0.15.0/geckodriver.exe" -Dphantomjs.binary.path="C:\Users\iris\AppData\Local\binman\binman_phantomjs\windows\2.1.1/phantomjs-2.1.1-windows/bin/phantomjs.exe" -jar "C:\Users\iris\AppData\Local\binman\binman_seleniumserver\generic\3.3.1/selenium-server-standalone-3.3.1.jar" -port 4567

当我再次尝试使用Chrome命令时,我收到同样的错误

rD <- rsDriver(verbose = FALSE)
Error in checkError(res) : 
  Couldnt connect to host on http://localhost:4567/wd/hub.
  Please ensure a Selenium server is running.
In addition: Warning message:
In rsDriver(verbose = FALSE) : Could not determine server status.

此问题是否有任何解决方法或我在前面的步骤中做错了什么?

0 个答案:

没有答案