2

Seeking help on how to resolve the subject line error.

The many previous posts and solutions referenced here have already been reviewed/tried.

In the past this same error has been resolved by updating R, Rstudio.

The code, which has worked for years and as recently as few days ago:

library(chromote) # to get the chrome version
library(netstat) # to dynamically change ports
library(RSelenium) # to run Selenium

b <- ChromoteSession$new()
browser_version <- b$Browser$getVersion()$product
browser_version<-gsub(".*/","",browser_version)

realVersion <- substr(browser_version,1,3)

chromeVersions <- binman::list_versions("chromedriver")
chromeVersions <- chromeVersions$win32

realChromeVer <-chromeVersions[which(substr(chromeVersions,1,3)==realVersion)]

driver <- rsDriver(browser = 'chrome', port = free_port(random = TRUE), chromever = realChromeVer[1], verbose = F)
remdr <- driver[['client']]
remdr$maxWindowSize()

Error message:

Could not open chrome browser.
Client error message:
Undefined error in httr call. httr output: Failed to connect to localhost port 3918: Connection refused
Check server log for further details.
Warning message:
In rsDriver(browser = "chrome", port = free_port(random = TRUE),  :
  Could not determine server status.

Is there anyway to get this running with rsDriver?
I would be really thankful if someone could help me in this problem.

r2evans
  • 141,215
  • 6
  • 77
  • 149
IMB
  • 41
  • 3

1 Answers1

0

See the answers here https://stackoverflow.com/a/75176907/15363011 and here https://github.com/ropensci/RSelenium/issues/264

The issue is likely that the newest Chrome versions (109+) are creating a bug that is preventing wdman::selenium() from running. Did you try deleting the license file in the chrome driver paths set by RSDriver (via the wdman package)?