Working with Selenium in Rstudio cloud

Hello, has anyone had any success working with the Rselenium package in Rstudio cloud? I am not sure if this is doable?? My code is :


rs_driver_object <- rsDriver(browser = "chrome",
chromever = "108.0.5359.71",
verbose = F,
port = free_port()

however I only get the following error message:

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.

RSelenium provides a set of R bindings for the 'Selenium 2.0 WebDriver', which in turn provides tool to enable automation of web browsers. Posit Cloud. However, Posit Cloud, as a hosted service, won't be able to open and control a separate web browser (hence the error, "Could not open chrome browser.")

I think the simplest solution now would be to run this on your local machine, where you have control over your OS and can configure Selenium.

1 Like

You can also look into "headless" versions of RSelenium.

1 Like

@JaRiCo So I figured out how to do it.
Above is some working Selenium code that works in the Rstudio Cloud. There are a ton of caveats some that apply all versions of Selenium that have to do with the latest release. I need to find someone who actually works on Rstudio Cloud to answer them.(*)

@EconomiCurtis @andy_kipp I need your help with those caveats there is a "configuration" folder that needs to be edited after RSelenium is installed. There is a way for users to find this folder. There is a R command line-like way, but it may be easier to have a good way of navigating.

@EconomiCurtis is there a way for me to share an Rstudio cloud instance. The test build that I got RSelenium working is here. ... however... I don't know where the "share" button is for Rstudio cloud.

@andy_kipp I also asked this related question. I am honestly curious to know because there could be more advantage to using Rstudio if it were possible. Can you have Firefox/GeckoDriver or Chrome/ChromeDriver in any version of Posit Cloud/Shiny/Workbench?
Based on EconomicCurtis answer, it might be know.

Also @andy_kipp (Profile - andy_kipp - RStudio Community) indeed needs to run headless. As the general answer is that Selenium cannot run in google/AWS/Rstudio/Azure is because there is no /usr/bin/google-chrome executable. Which is why there is actually a 2 Selenium python packages and 2 free Selenium cloud options (Selenium Grid and a python Selenium docker container).

(*)P.S. @EconomiCurtis I am not just asking for the sake of this question, but in a broader scope that has to do with operating system crashes. I don't want the Rstudio Cloud to face the mess that is R on Windows 11. The operating system concern while figuring out a solution JaRiCo post is why I am continuing this thread

P.P.S. RSelenium is looking for a package maintainer. And Selenium technical lead has offer support of whoever the new maintainer is. There are several people including Fulton County Government (my workplace) and a second developer who have offered to support the maintainer. If you know someone who can maintain a package it is need.

@EconomiCurtis @andy_kipp
Finally a question I forgot to ask to some who works on Rstudio Cloud.

Can a user install linux software in the Rstudio cloud or request them installed on the paid version of Rstudio Cloud? I specifically asking about the linux software that has the "depreciated" netstat package.

(*)P.S. Much like telnet, netstat is anything but depreciated. Both are useful for debugging firewall and cybersecurity bugs. The R version of netstat can be buggy and not work properly as I have commented on in the Rstudio github before. For Selenium V 3.0 and Selenium 4.0, netstat can be useful in debugging when using python version of Selenium.

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.