Setting RSelenium

Hi,

I'm having a problem when trying to set RSelenium. When I run:

rsDriver(browser=c("chrome"))

I get the following error:

Error in java_check() : PATH to JAVA not found. Please check JAVA is installed.

I already installed Java from https://www.java.com/es/ but I think this is not what R is asking me to do. Any idea on how to fix this issue?

Thanks

Installing Java was the right call, but R is having problems to find out where is installed, you can specify the path by setting the JAVA_HOME environmental variable, how to do it, depends on your operating system, Can you provide more information?

1 Like

Thanks for the answer.

I have Windows 10, 64 bits.

I've been following the instructions step by step from https://cimentadaj.github.io/blog/2018-05-25-installing-rjava-on-windows-10/installing-rjava-on-windows-10/ but the problem persists.

I'm using a 64-bit version of Java. After installing JDK I set my JAVA_HOME environment with the command:

Sys.setenv(JAVA_HOME="C:/Program Files/Java/jdk-15.0.1/")

Yet, each time I try to use the rsDriver function, I face the same error.

Where are you setting JAVA_HOME? If you simply set it on the R console it is going to work just for that individual session and it is very likely that you need a session restart. It is better to set it on a startup file like Renviron.site or Rprofile.site

1 Like

Thanks! After restarting the session it worked.

However, now I'm facing the following error:

Could not open chrome browser.
Client error message:
Summary: SessionNotCreatedException
Detail: A new session could not be created.
Further Details: run errorDetails method
Check server log for further details.

I've been reading and it may be due to the fact that the driver is not compatible with the current version of chrome (Error could not open chrome browser · Issue #203 · ropensci/RSelenium · GitHub). My chrome version is 86.0.4240.111 , but my "available driver versions" seem to be "85.0.4183.87", "86.0.4240.22", or "87.0.4280.20" (I obtain this information by running binman::list_versions("chromedriver"). Do you know if there is any way to make these things compatible?

Thanks again

I was able to solve this problem using Firefox. Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.