0

According to this answer https://stackoverflow.com/a/72793082/2554330, there are some bugs in the latest version of chromedriver that have been fixed in the version that works with Google Chrome Beta, so I'd like to try the beta.

This answer https://stackoverflow.com/a/65975577/2554330 shows how to run Google Chrome Beta from Javascript. I'd like to do the same from RSelenium, but I can't spot an equivalent of chrome_options.binary_location.

How do I specify the Chrome location when using RSelenium?

user2554330
  • 37,248
  • 4
  • 43
  • 90
  • You may pass a `binary` option to specify binary location in the `extraCapabilities` argument when calling `remoteDriver`. I found [this issue](https://github.com/ropensci/RSelenium/issues/31#issuecomment-60505054) may be related. – hellohawaii Jul 08 '22 at 06:50
  • Thanks, that looks very helpful. If you want the bounty, please write it up as an answer. – user2554330 Jul 08 '22 at 10:29

2 Answers2

1

Try following codes:

cPath <- "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
ecap <- list(chromeOptions = list("binary" = cPath))
remDr <- remoteDriver(browserName = "chrome", extraCapabilities = ecap)
remDr$open()

Note that startServer() func is now defunct.

These were obtained from this comment by the author of RSelenium.

user2554330
  • 37,248
  • 4
  • 43
  • 90
hellohawaii
  • 3,074
  • 6
  • 21
0

Try this, the chromedriver is wherever you place it and the beta browser is wherever it gets installed. It's been a long time since I used r/selenium, so slashes maybe the wrong way

require(RSelenium)
RSelenium::startServer(args = c("-Dwebdriver.chrome.driver=C:\\Users\\me\\Documents\\chromedriver.exe")
            , log = FALSE, invisible = FALSE)

remDr <- remoteDriver(
  browserName = "chrome",
  extraCapabilities = list("chrome.binary" = "C:\\Program Files\\ChromeBeta\\chrome.exe")
)
remDr$open()

head(remDr$sessionInfo)
djmonki
  • 3,020
  • 7
  • 18