0

I just started trying to work with RSelenium but I can't get a Chrome session to start. Using the following code

library(dplyr)
library(RSelenium)
library(netstat)

# Start the server
rs_driver_object <- rsDriver(browser = 'chrome',
                             chromever = '103.0.5060.53',
                             port = free_port())

I cannot get anything to work. Instead, I get the following console output:

checking Selenium Server versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking chromedriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking geckodriver versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
checking phantomjs versions:
BEGIN: PREDOWNLOAD
BEGIN: DOWNLOAD
BEGIN: POSTDOWNLOAD
[1] "Connecting to remote server"

Selenium message:Timed out waiting for driver server to start.
Build info: version: '4.0.0-alpha-2', revision: 'f148142cf8', time: '2019-07-01T21:30:10'
System info: host: 'LEAVING OUT HOST FOR SECURITY', ip: 'LEAVING OUT IP FOR SECURITY', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '18.0.1.1'
Driver info: driver.version: unknown

Could not open chrome browser.
Client error message:
     Summary: UnknownError
     Detail: An unknown server-side error occurred while processing the command.
     Further Details: run errorDetails method
Check server log for further details.

I left out my host name and IP for security purposes. Does anyone know what I can do to solve this issue and get selenium running?

  • Why `Build info: version: '4.0.0-alpha-2'` instead of the latest **4.3.0**? Chrome & ChromeDriver version? – undetected Selenium Jul 06 '22 at 21:22
  • @undetectedSelenium my Chrome version is 103.0.5060.53. According to the ChromeDriver I installed trying to troubleshoot this, that is version 103.0.5060.53 as well. What does the build info version refer to? – YetAnotherQuestion Jul 06 '22 at 21:41
  • Not sure if there is a dependency on R. Mainly Selenium, Chrome & ChromeDriver needs to be in sync. See [this](https://stackoverflow.com/a/48551748/7429447) discussion for more details. – undetected Selenium Jul 06 '22 at 21:50
  • @undetectedSelenium I think I actually used the link in the discussion you posted to download the ChromeDriver that I have installed. I have the Selenium server, Chrome Driver, and Java jdk all installed so I don't know what is causing this issue. I'll try updating R and RStudio, but if that doesn't work I guess I've hit a dead end and Selenium isn't in my future lol. Thanks for the help! – YetAnotherQuestion Jul 06 '22 at 22:20
  • You're using an alpha version of Selenium. Get the latest release version here: https://www.selenium.dev/downloads/ Update the client + bindings (and the grid if you need it) – pcalkins Jul 06 '22 at 22:28
  • @pcalkins I've downloaded the latest version. Am I correct in thinking I need to put in in a particular library on my computer? I've been watching some tutorials which say to install this through creating a java project, but is that necessary? – YetAnotherQuestion Jul 06 '22 at 22:59
  • No, RSelenium is sufficient. It includes Selenium. There are some serious recent bugs in the 103.0.5060.53 Chromedriver, but I haven't seen the symptoms you have. Apparently these are fixed in the 104.x version, but you may need to wait for Chrome to catch up. – user2554330 Jul 06 '22 at 23:09
  • I'm not familiar with RSelenium, but seems like it's Ruby? So get the Ruby client + bindings. Your post clearly shows the alpha version running: "Build info: version: '4.0.0-alpha-2" The Selenium "server" will relay commands to/from webdriver and browser. The browser could be on your local machine or remotely on a "grid". – pcalkins Jul 06 '22 at 23:29
  • @pcalkins when watching a tutorial on how to use RSelenium, it said to make sure to have Java jdk installed, not Ruby, since it makes use of Java. So I'm sure that the Java install is the one to use. However, even after installing this, it still says the build version is the alpha, so maybe I have Selenium saved in the wrong location? If so, I don't know where I should put the Selenium files – YetAnotherQuestion Jul 07 '22 at 00:02

1 Answers1

1

@user2554330 said that there might be issues with RSelenium reacting to the current version of Chrome, so based on this and some other comments I read, I decided to use RSelenium in Firefox as opposed to Chrome and it worked. The code I used is:

rs_driver_object <- rsDriver(browser = 'firefox',
                             port = free_port())

It might be worth it to try this again in the future using Chrome, but for now, this basic code in firefox seems to work