3

I am trying to open a remote driver using the RSelenium package with Chrome driver and encountering the following error:

    >> library("XML")
    >> library('RSelenium')
    >> checkForServer()
    Warning message:
    In order(as.numeric(gsub("(.*)/.*", "\\1", selJAR)), decreasing = TRUE) :
    NAs introduced by coercion
    >> startServer()
    Warning message:
    running command 'java -jar "C:/Users/Jessica/Documents/R/win-library/3.4/RSelenium/bin/selenium-server-standalone.jar"' 
    had status 127 
    >> remDr=remoteDriver$new()
    >> remDr$open() # open web browser
    [1] "Connecting to remote server"
    Error in function (type, msg, asError = TRUE)  : 
    Failed to connect to localhost port 4444: Connection refused

But it seems that I am having a difficult time establishing a connection.

I think the error message after the startServer() is implying that R is unable to establish a serenium server.

One way I tried to resolve the issue is by copying both the selenium-server-standalone.jar and chromedriver.exe files into the document folder so R can find them. But so far no luck in establishing a server. What am I missing? I appreciate your help.

jessica
  • 1,325
  • 2
  • 21
  • 35
  • Try reading these vignettes;https://rpubs.com/johndharrison/RSelenium-Docker & http://rpubs.com/johndharrison/RSelenium-Basics – Steve austin Jul 14 '18 at 20:06
  • Maybe this will help: https://stackoverflow.com/questions/50193152/css-selector-issue-with-rvest-and-nhl-statistics – papelr Jul 15 '18 at 21:04
  • I highly recommend using a docker instance of RSelenium to get it running if possible. Lots of instructions available online but an older example of how to do this is located at: https://github.com/adam-sampson/Job_Desc_Text_Analytics/blob/master/webscraping/readme.md. Also recommend using Rvest instead of RSelenium when possible (...unfortunately not always possible). – Adam Sampson Jul 16 '18 at 14:21
  • 1
    @Jessica - Did we resolve your issue? Just checking. – Technophobe01 Jul 18 '18 at 16:32
  • Hi! So I found out what the issue is.I need to update java to my 64 bit computer. The connection errors to the server were a result of updating to the correct version of Java. – jessica Jul 30 '18 at 20:25

0 Answers0