user2554330
user2554330

Reputation: 44997

How to use Google Chrome Beta with RSelenium

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?

Upvotes: 0

Views: 405

Answers (2)

hellohawaii
hellohawaii

Reputation: 3084

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.

Upvotes: 1

djmonki
djmonki

Reputation: 3957

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)

Upvotes: 0

Related Questions