I just ran into the same kind of error using RSelenium::rsDriver()'s default chromever = "latest" set which resulted in the failed attempt to combine chromedriver 75.0.3770.8 with latest google-chrome-stable 74.0.3729.157:
session not created: This version of ChromeDriver only supports Chrome version 75
Since this obviously seems to be a recurring and pretty annoying issue, I have come up with the following workaround to always use the latest compatible ChromeDriver version:
rD <- RSelenium::rsDriver(browser = "chrome",
chromever =
system2(command = "google-chrome-stable",
args = "--version",
stdout = TRUE,
stderr = TRUE) %>%
stringr::str_extract(pattern = "(?<=Chrome )\\d+\\.\\d+\\.\\d+\\.") %>%
magrittr::extract(!is.na(.)) %>%
stringr::str_replace_all(pattern = "\\.",
replacement = "\\\\.") %>%
paste0("^", .) %>%
stringr::str_subset(string =
binman::list_versions(appname = "chromedriver") %>%
dplyr::last()) %>%
as.numeric_version() %>%
max() %>%
as.character())
The above code is only tested under Linux and makes use of some tidyverse packages (install them beforehand or rewrite it in base R). For other operating systems you might have to adapt it a bit, particularly replace command = "google-chrome-stable" with the system-specific command to launch Google Chrome:
On macOS it should be enough to replace
command = "google-chrome-stable" with command = "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" (untested)
On Windows, a platform-specific bug prevents us from calling the Google Chrome binary directly to get its version number. Instead, do the following:
rD <- RSelenium::rsDriver(browser = "chrome",
chromever =
system2(command = "wmic",
args = 'datafile where name="C:\\\\Program Files (x86)\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe" get Version /value',
stdout = TRUE,
stderr = TRUE) %>%
stringr::str_extract(pattern = "(?<=Version=)\\d+\\.\\d+\\.\\d+\\.") %>%
magrittr::extract(!is.na(.)) %>%
stringr::str_replace_all(pattern = "\\.", replacement = "\\\\.") %>%
paste0("^", .) %>%
stringr::str_subset(string = binman::list_versions(appname = "chromedriver") %>%
dplyr::last()) %>%
as.numeric_version() %>%
max() %>%
as.character())
Basically, the code just ensures the latest ChromeDriver version matching the major-minor-patch version number of the system's stable Google Chrome browser is passed as a chromever argument. This procedure should adhere to the official ChromeDriver versioning scheme. Quote:
ChromeDriver uses the same version number scheme as Chrome (...)
Each version of ChromeDriver supports Chrome with matching major, minor and build version numbers. For example, ChromeDriver 73.0.3683.20 supports all Chrome versions that start with 73.0.3683.
For more knowledge about Selenium, you may go through Selenium tutorial and Selenium training course by Intellipaat.
Watch this video on Selenium Tutorial for Beginners