0

Trying to set up RSelenium as described in this article:
https://www.geeksforgeeks.org/how-to-set-up-rselenium-for-r/

When I try to set up the driver in my R code, I get the following error message:

Could not open chrome browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to localhost port 4567 after 0 ms: Couldn't connect to server
Check server log for further details.
Warning message:
In rsDriver(browser = "chrome") : Could not determine server status.

I try to check the server log but all I see is:

$stderr
[1] ""

$stdout
[1] ""

Any suggestions?

djmonki
  • 3,020
  • 7
  • 18
JGrinz
  • 1
  • Test wether this works: go to the chromedriver directory (to find it: `print(binman::app_dir("chromedriver"))`), go to the last version or the version you're using, then delete the LICENSE.chromedriver file. – Ric Jul 10 '23 at 02:36

1 Answers1

0

You need to download the latest ChromeDriver i.e. v114.0.5735.90 and the minimal code block will be:

# R program to demonstrate RSelenium

# load the required packages
library(Rselenium)

# start the Selenium server
rdriver <- rsDriver(browser = "chrome",
            port = 2122L,
            chromever  = "114.0.5735.199",
            )

# creating a client object and opening the browser
obj <- rdriver$client

# navigate to the url
obj$navigate("https://www.geeksforgeeks.org/")

# closing the browser
obj$close()
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352