ScreenshotNeo

BlogHow-to

How to Download and Set Up Selenium

Install a Selenium language binding, choose a browser, and run your first WebDriver script. Learn when Selenium Manager works and how to fix driver setup problems.

By the ScreenshotNeo team4 October 202610 min read

Direct answer: install Selenium’s language binding with that language’s package manager, install a supported browser, then create a WebDriver session. With Selenium 4.6 or later, Selenium Manager usually finds or downloads the compatible browser driver for you, so a separate driver download is not the normal first step. You do not need Selenium Server for a basic script running on your own computer.

Selenium is a browser automation project, not one universal installer. The binding is the library your program uses; WebDriver is the browser automation interface; and a browser-specific driver connects WebDriver to a browser. Start with Selenium’s official downloads page and the getting started documentation. The downloads page listed Selenium 4.49.0 as stable, released September 9, 2026, when checked for this guide. That is a point-in-time version; check the current page before installing.

1. Choose a language and install its Selenium binding

Choose the binding for the language you plan to use. Selenium lists Java, Python, JavaScript, Ruby, and .NET/C# bindings. Each uses its own package or build tool; follow the current official library installation guide for the exact command and supported versions.

Python

The documented install command is pip install selenium. The Python API documentation recommends using a virtual environment and documents Python 3.10 or later for its current release.

python -m venv .venv

# macOS or Linux
source .venv/bin/activate

# Windows PowerShell
# .venv\Scripts\Activate.ps1

python -m pip install --upgrade pip
python -m pip install selenium

Use the activation command for your operating system, not both. If your shell does not recognize python, use the Python executable name installed on your system, such as python3.

Java

Add Selenium’s Java library to your project with its build tool, following the version and dependency coordinates on the official installation page. The code later in this guide shows the shape of a Java WebDriver session; include the Selenium dependency before compiling it.

JavaScript

Install the Selenium WebDriver package with npm in your project, as described in the official library installation page. The JavaScript example below uses Node.js modules and an asynchronous cleanup block.

Ruby and .NET/C#

Use the official installation instructions for the Ruby gem or .NET package. Package names, framework configuration, and supported runtime versions are language-specific, so do not substitute Python’s pip command for those bindings.

2. Install or select a supported browser

Selenium automates browsers through WebDriver. Its driver documentation covers Chrome/Chromium, Firefox, and Edge across Windows, macOS, and Linux; Safari’s driver is built into supported macOS versions. Internet Explorer is Windows-only. Browser support and requirements can change, so consult the current browser driver documentation for your platform. The documentation describes Opera’s driver as officially unsupported.

Install the browser you intend to automate and make sure it can launch in your user account. You can use more than one browser, but each browser has its own driver and platform requirements.

3. Let Selenium Manager handle the driver first

Older Selenium setup guides often ask you to find a browser driver executable, match it to the installed browser, and place it on your PATH. Current Selenium usually handles that step through Selenium Manager, which is bundled with Selenium releases starting at version 4.6. It is invoked by the language binding when no driver has already been supplied. Selenium Manager can discover the browser version, resolve and download a compatible driver, and cache the downloaded assets. Current documentation also describes browser management for Chrome, Firefox, and Edge.

You do not normally install Selenium Manager separately. Install a current Selenium binding, then create the browser’s driver object. On the first run, Selenium Manager may need network access to check vendor metadata and download a driver. Later starts can use its cache.

Approach Use it when Trade-off
Selenium Manager (default) You use a current binding and a supported browser on a typical connected machine. Less setup and driver maintenance; first-time resolution needs network access and some platforms have documented limitations.
Driver on PATH You manage drivers centrally or need a specific executable available to programs. Simple to reference, but you must keep the driver compatible and PATH correct.
Explicit Service path You need control over the exact driver location or use a configuration Selenium Manager cannot handle. Explicit and useful for troubleshooting; a hard-coded path can make scripts less portable.

Selenium Manager can fail behind a proxy or firewall that blocks vendor metadata or download endpoints. Its documentation also notes platform constraints: the default Linux manager binary has been verified for x64, and Linux ARM64/aarch64, 32-bit Linux, and Raspberry Pi configurations may need a custom manager binary or explicit Service path. See the Selenium Manager documentation before choosing a fallback.

4. Run your first WebDriver script

Save and run the example for your chosen language. It opens a public page, prints its title, and closes the browser session even if navigation or printing raises an error. The first run can take longer while a driver is resolved or downloaded.

Python

from selenium import webdriver

# Selenium Manager finds or downloads the driver when needed.
driver = webdriver.Chrome()
try:
    driver.get("https://www.selenium.dev/")
    print(driver.title)
finally:
    driver.quit()

To use another browser, use its binding class, such as webdriver.Firefox() or webdriver.Edge(), after confirming browser support for your platform.

Java

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class FirstSeleniumRun {
    public static void main(String[] args) {
        WebDriver driver = new ChromeDriver();
        try {
            driver.get("https://www.selenium.dev/");
            System.out.println(driver.getTitle());
        } finally {
            driver.quit();
        }
    }
}

Add the Selenium Java dependency using the official installation instructions, then compile and run this class with your project’s Java build setup.

JavaScript (Node.js)

const { Builder } = require('selenium-webdriver');

(async function firstSeleniumRun() {
  const driver = await new Builder().forBrowser('chrome').build();
  try {
    await driver.get('https://www.selenium.dev/');
    console.log(await driver.getTitle());
  } finally {
    await driver.quit();
  }
})();

Install the JavaScript Selenium package using the official instructions before running this file. The asynchronous finally block releases the browser session when navigation or title retrieval fails.

Ruby

require 'selenium-webdriver'

driver = Selenium::WebDriver.for :chrome
begin
  driver.navigate.to 'https://www.selenium.dev/'
  puts driver.title
ensure
  driver.quit
end

Install the Ruby binding as described by Selenium, then run the script with Ruby in the environment where the gem is available.

.NET/C#

using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;

using IWebDriver driver = new ChromeDriver();
try
{
    driver.Navigate().GoToUrl("https://www.selenium.dev/");
    Console.WriteLine(driver.Title);
}
finally
{
    driver.Quit();
}

Add the Selenium WebDriver package using the official .NET instructions and run this code in a configured C# project.

A successful run opens the browser, loads the page, prints its title, and closes the browser. If it exits before that, use the error text and troubleshooting table below to identify whether the problem is the binding, browser, driver, network, or platform.

5. Configure a driver manually when needed

Manual setup is a fallback for older Selenium versions, explicit version/location control, restricted or offline environments, and configurations where Selenium Manager cannot run. Download the driver from the browser vendor or the current Selenium driver guidance, confirm it is compatible with the installed browser, and choose one of these approaches:

  1. Put the executable on PATH. Place it in a directory your user or process searches for executables. Start a new terminal or process if you changed PATH.
  2. Provide a Service path. Configure the binding’s browser-specific Service object to point to the driver executable. This avoids relying on PATH but may tie the script to a machine-specific path.

For Python, the explicit Service form looks like this:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service

service = Service(executable_path="/absolute/path/to/chromedriver")
driver = webdriver.Chrome(service=service)
try:
    driver.get("https://www.selenium.dev/")
    print(driver.title)
finally:
    driver.quit()

Replace the example path with the driver executable’s actual location. Keep driver binaries out of source control unless your project intentionally manages them, and make platform-specific paths configurable when sharing the script.

6. Know when Selenium Server or Grid is necessary

A local script uses a browser on the same machine and does not require Selenium Server. Selenium Server/Grid is relevant when your client needs remote WebDriver sessions or when you distribute execution across machines or browser environments. Start with Selenium’s WebDriver documentation and the official downloads page for Grid setup. Adding Grid to a first local script adds infrastructure without helping the basic installation.

7. Troubleshoot common setup errors

Symptom Likely cause Fix
“Unable to locate driver” or driver executable not found An older binding, a missing/manual driver path, or a driver that is not discoverable. Upgrade to a current Selenium binding and retry with Selenium Manager. If managing it manually, check PATH or pass the correct executable to the Service object.
Selenium Manager cannot download or resolve a driver Proxy/firewall blocks vendor metadata or downloads, or the host has no network access. Configure the environment’s proxy/network access for the required endpoints, or download a compatible driver through an approved route and configure its path explicitly.
Driver starts but reports a browser/driver version mismatch The manually installed driver does not match the installed browser well enough. Use Selenium Manager with a current binding, or replace the manual driver with one compatible with that browser version.
Executable exists but will not start Wrong operating system or CPU build, missing execute permission, or a blocked executable. Use the correct vendor build for the host architecture, grant execution permission where appropriate, and check operating-system security policy.
Works in a terminal but fails in an IDE, service, or scheduled task The process has a different PATH, environment, proxy configuration, or user account. Compare the runtime environment, configure the Service path or required environment settings explicitly, and run under the intended account.
Linux ARM64, 32-bit Linux, or Raspberry Pi manager limitation The default Selenium Manager Linux binary may not support that architecture/configuration. Consult Selenium Manager’s platform notes; use a custom manager or configure a compatible browser driver explicitly.
Browser opens but the page is blank or navigation times out The target site is unavailable to the machine, navigation is waiting longer than expected, or the page has its own access requirements. Check the URL and network access in a regular browser, inspect the exception, and use explicit waits for page conditions your automation actually needs.
Browser remains open after an error The script did not call quit() when control left the main flow. Put cleanup in finally (or the language’s equivalent) so it runs after both successful and failed operations.

For driver discovery details and current error guidance, use Selenium’s browser driver troubleshooting page.

8. Keep setup reliable and efficient

  • Pin project dependencies where reproducibility matters. Use your language’s dependency lock or version management so another developer can install the same binding version.
  • Keep the browser and driver relationship valid. Selenium Manager reduces manual driver upkeep; if you pin a driver, revisit it when updating the browser.
  • Expect a first-run network step. Driver metadata checks and downloads can affect startup on a new machine. Prepare an explicit driver route for network-restricted environments.
  • Always end sessions. Call quit() in a cleanup path; this closes the WebDriver session and browser processes.
  • Use Grid only when the execution model requires it. Remote and distributed sessions add infrastructure and configuration. A local first script does not need them.

Selenium is software, and the normal binding plus Selenium Manager workflow does not require buying a separate driver. The main setup costs are the developer time and infrastructure involved in maintaining browsers, drivers, and, for remote/distributed work, Grid. Selenium Manager can cache downloaded assets, but the first resolution still depends on connectivity when a driver is missing.

Or skip the browser setup

If your goal is a screenshot rather than browser automation, ScreenshotNeo is a website screenshot API and MCP server for developers. One GET request returns an image or PDF. It handles browser setup for the capture: cookie banners are accepted and removed along with 60+ known consent platforms, newsletter popups, and chat widgets before the shot. Bot checks, blank pages, failed loads, timeouts, and cache hits cost nothing, and response headers say the page verdict and whether it was billed. Its MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

Here is a one-call example. See the ScreenshotNeo API documentation for parameters and response details.

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

Python:

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Create a free ScreenshotNeo account for 1,000 screenshots a month with no card.

Frequently asked questions

Is Selenium free to install?

Selenium bindings are installed as software through their language package tools. Check the official project documentation for current licensing and distribution details.

Do I need to install every browser?

No. Install the browser you intend to automate. Add other browsers only if your scripts need to run against them.

Can Selenium take website screenshots?

Yes. WebDriver can capture screenshots as part of browser automation. If you only need an image or PDF from a URL, ScreenshotNeo offers a direct screenshot API and MCP tools.

When should I use a remote browser?

Use a remote session when the browser should run on another machine or you need distributed execution. A local script can start without Selenium Server/Grid.