Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

RSelenium lets R send commands to a browser through Selenium’s Remote WebDriver interface. To get started, install the R package, make sure you have a browser and a compatible WebDriver/Selenium Server setup, then create a session with rsDriver(). Because browser, driver, server, and package compatibility depends on the versions in your environment, check the current RSelenium documentation rather than assuming one setup works everywhere.

What RSelenium does—and what you need

RSelenium is an R client for Selenium Remote WebDriver. It does not itself contain a browser: your R code sends WebDriver commands, a browser-specific driver connects those commands to a browser, and the browser performs the requested action. Selenium’s getting-started guide describes these as separate parts of browser automation: Selenium WebDriver Getting Started.

For a local run, plan for these components:

  • R and RSelenium: the package that lets your R code communicate with a WebDriver endpoint.
  • A browser: for example, Chrome or Firefox, installed in the environment where the browser session will run.
  • A compatible driver/server arrangement: the driver bridges WebDriver commands to the chosen browser; Selenium Server may also be part of the arrangement used by the startup helper.

The RSelenium project points new users to install from CRAN and read its basics vignette. It also documents local and remote configurations and Docker options. See the RSelenium project repository for current package guidance and vignettes.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install RSelenium and open the basics vignette

Install the CRAN release from an R console:

install.packages("RSelenium")

Then open the introductory vignette bundled with the installed package:

vignette("basics", package = "RSelenium")

If you specifically need the development version, the project repository also documents this route. Install remotes first if it is not already installed:

# install.packages("remotes")
remotes::install_github("ropensci/RSelenium")

For ordinary use, start with CRAN unless you have a reason to use development code. Record which package version you installed, especially when sharing a reproducible script or debugging a setup.

Start a local session, navigate, and shut it down

The following is the basic lifecycle pattern documented for rsDriver(). It starts a driver/server arrangement, obtains the client, navigates to a page, closes the browser session, and stops the server:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
rD <- rsDriver()
remDr <- rD[["client"]]

remDr$navigate("https://www.r-project.org/")

remDr$close()
rD[["server"]]$stop()

Run the cleanup calls when you finish. Closing the WebDriver session and stopping the server are separate operations: the first closes the browser session; the second stops the server process managed through the returned object. If an error occurs after startup, run the cleanup for whichever objects were successfully created before retrying.

What rsDriver() returns

The helper returns an object containing a server and a client. In the example, rD[["client"]] is the object used for browser commands such as navigate(); rD[["server"]] is used to stop the server at the end. The reference documents a default port of 4567, browser choices including Chrome and Firefox (along with legacy options), and configurable Selenium Server and driver versions. Its reference page reports package version 1.7.9, so use it for the helper’s documented pattern, not as evidence of the latest release or a guaranteed version pairing: rsDriver reference.

Check options before relying on defaults

Defaults, available binaries, and supported browser options can change. Consult the documentation for your installed RSelenium version, verify which browser is installed, and choose versions deliberately if the helper exposes those options in your setup. Do not assume that a default server or driver version is suitable for every current browser installation.

Local or remote browser: choose where the session runs

A local setup is useful when you want control over the machine and can debug the browser directly. A remote setup is useful when the browser should run on another machine or through a hosted cross-browser service. In either case, the key question is where the browser and its compatible driver/server arrangement are running—not simply where the R script is running.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Consideration Local execution Remote execution
Setup control You manage the browser and its driver/server components on the machine running the browser. The browser runs in a separate environment; you configure R to connect to its WebDriver endpoint.
Debugging You can inspect the local browser and environment directly. Debugging depends on the remote environment and the provider’s available diagnostics.
Browser and OS choice Constrained by browsers and operating systems available on your machine. May provide access to browsers or operating systems not installed locally; verify the provider’s current offerings.
Version management You control and should record package, server, driver, and browser versions. Check how the remote environment selects and updates browser and driver versions.

The RSelenium repository includes remote connection examples naming Sauce Labs and BrowserStack. Treat these as examples of hosted execution, not as a current endorsement or confirmation of present-day features, availability, prices, security terms, or compatibility. Check each provider’s current documentation before choosing one.

Understand browser and driver compatibility

A browser update can break a previously working session if the driver no longer matches the browser. Selenium’s documentation explains that Selenium Manager, included in Selenium releases as of version 4.6, can manage drivers when one is not otherwise supplied, and describes the stale-driver problem after Chrome updates: Selenium Manager documentation.

That does not establish that RSelenium’s current rsDriver() startup flow invokes Selenium Manager. Do not assume that installing a recent Selenium release automatically makes RSelenium manage drivers for you. The reviewed documentation also does not establish a definitive compatibility matrix between RSelenium 1.7.10 and Selenium Server versions, or settle whether the current RSelenium startup flow fully supports Selenium 4’s W3C WebDriver protocol. Confirm package-specific guidance for the exact environment you intend to run.

The CRAN mirror listing reported RSelenium 1.7.10, published 2026-02-19; that is release metadata, not proof that a particular browser, driver, and server combination interoperates. See the CRAN package listing and compare it with your installed package version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot a session that will not start

Driver or browser version mismatch

Symptom: startup fails, the browser does not launch, or a session that used to work fails after a browser update. What to check: the installed browser version, the driver version selected or installed for it, the Selenium Server version, and the RSelenium version. Change the mismatched component based on current package and Selenium documentation rather than editing unrelated R code.

Browser is missing or installed in a different environment

Symptom: the driver cannot find or launch the requested browser. Fix: confirm that the browser is installed in the same machine or container where the browser session runs. In a remote setup, check the remote machine or service configuration, not only the computer running R.

Port conflict or unreachable endpoint

Symptom: the server cannot bind to its port, or the client cannot connect. Fix: check whether another process is using the configured port, whether the server started successfully, and whether the client is pointed at the correct endpoint. The rsDriver() reference documents 4567 as its default port; use the installed version’s documentation if you configure a different port.

Session left behind after an error

Symptom: a retry encounters a running process or occupied port. Fix: close the client session and stop the server when their objects exist. In a fresh R session, verify whether the previous server process is still running before starting another one.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Unsure which pairing is supported

Symptom: package installation succeeds, but the browser/server combination remains uncertain. Fix: record the exact RSelenium, browser, driver, and Selenium Server versions; consult the current RSelenium package documentation and release notes for that combination. Do not infer compatibility from a successful package installation alone.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make runs reproducible

Browser automation depends on more than the R script. For a repeatable run, record the versions and execution location that affect the session:

  • RSelenium package version and R environment.
  • Browser name and version.
  • Driver and Selenium Server versions, where applicable.
  • Whether the browser is local, containerized, or hosted remotely.
  • Any non-default port or version options passed to the startup helper.

Pin or deliberately manage these components according to your environment’s supported process. If you rely on automatic driver management, first confirm that the specific tool and RSelenium startup path you are using actually provide it.

Or skip the browser setup

If your goal is to capture a page image or PDF rather than interact with a live browser, ScreenshotNeo offers a website screenshot API and MCP server. A single GET request can return a PNG, JPEG, WebP, or PDF. Its clean-shot options accept consent banners like a visitor and remove more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For this route, you need an API key. See the ScreenshotNeo API documentation for setup and options. Example cURL request:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Create an account at ScreenshotNeo sign-up to start with the free allowance.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.