Python browser automation libraries

Updated Nov 2026

Python browser automation libraries control a real browser from code to click, type, navigate, and read pages. A driver sends commands to the browser over the WebDriver standard or the Chrome DevTools Protocol. These libraries let test suites, scrapers, and AI agents operate websites that have no API.

Popularity

Playwright has the most monthly downloads in this comparison, at 129.4M.

LibraryMonthly downloadsStarsLast releaseLicense
Playwright
135.6M
15.1KNov 2026Apache-2.0
Selenium
30.4M
34.6KNov 2026Apache-2.0
Browser Use
7.3M
Not on GitHubNov 2026MIT
browser-use-sdk
6.0M
Not on GitHubOct 2026MIT
Patchright
5.4M
Not on GitHubNov 2026Apache-2.0
undetected-chromedriver
2.7M
Not on GitHubFeb 2024GPL-3.0
Stagehand
1.8M
Not on GitHubNov 2026MIT
SeleniumBase
1.2M
Not on GitHubNov 2026MIT
Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Automates Chromium, Firefox, and WebKit through a shared Python API.

Downloads / mo
135.6M
Stars
15.1K
Last release
1.65.2
License
Apache-2.0

Strengths

  • Waits before acting on elements. Actions wait for the relevant element checks before running.
  • Supports multiple browser engines. Automate Chromium, Firefox, and WebKit through the same library.

Limitations

  • Browser binaries track package versions. Install the browser binaries matching the Playwright package version.

Quickstart

From README.md
$ python3.11 -m pip install playwright==1.65.2 python3.11 -m playwright install chromium
from playwright.sync_api import sync_playwright

with sync_playwright() as client:
    browser = client.chromium.launch()
    page = browser.new_page()
    page.goto("https://example.com")
    browser.close()

Playwright examples

From open-source projects on GitHub

Automates browser interactions through WebDriver.

Downloads / mo
30.4M
Stars
34.6K
Last release
4.53.0
License
Apache-2.0

Strengths

  • Finds compatible drivers automatically. Selenium Manager finds the driver and downloads a browser when needed.
  • Queues browser input actions. Queue pointer actions and run them together with perform.

Limitations

  • Mixed waits change timeout behavior. Mixing implicit and explicit waits produces unpredictable wait times.

Quickstart

From first_script.py
$ python3.11 -m pip install selenium==4.53.0
from selenium import webdriver

driver = webdriver.Chrome()
try:
    driver.get("https://example.com")
finally:
    driver.quit()

Selenium examples

From open-source projects on GitHub

Browser Use

Runs a browser agent on Pydantic AI against cloud or local Chrome.

Downloads / mo
7.3M
Last release
1.0.6
License
MIT

Quickstart

From README.md
$ python3.11 -m pip install browser-use==1.0.6
from browser_use import Agent

result = Agent("Open https://example.com and return its title").run_sync()
print(result.final_result())

browser-use-sdk

Calls the Browser Use cloud API from Python.

Downloads / mo
6.0M
Last release
3.12.1
License
MIT

Quickstart

From README.md
$ python3.11 -m pip install browser-use-sdk==3.12.1
from browser_use_sdk.v4 import BrowserUse

with BrowserUse() as client:
    created = client.runs.create("Open https://example.com and return its title")
    result = client.runs.wait_for_completion(created.id)
    print(result.result)

Patches Playwright-compatible Chromium automation.

Downloads / mo
5.4M
Last release
1.64.4
License
Apache-2.0

Quickstart

From README.md
$ python3.11 -m pip install patchright==1.64.4 python3.11 -m patchright install chromium
from patchright.sync_api import sync_playwright

with sync_playwright() as client:
    browser = client.chromium.launch()
    page = browser.new_page()
    page.goto("https://example.com")
    browser.close()

Patchright examples

From open-source projects on GitHub

undetected-chromedriver

Starts a patched Chromium driver that stays compatible with Selenium.

Downloads / mo
2.7M
Last release
3.5.5
License
GPL-3.0

Quickstart

From __init__.py
$ python3.11 -m pip install undetected-chromedriver==3.5.5
import undetected_chromedriver as uc

driver = uc.Chrome()
try:
    driver.get("https://example.com")
finally:
    driver.quit()

undetected-chromedriver examples

From open-source projects on GitHub

Builds browser agents on Browserbase.

Downloads / mo
1.8M
Last release
4.4.0
License
MIT

Quickstart

From README.md
$ python3.11 -m pip install stagehand==4.4.0
import asyncio
import os
from stagehand import Stagehand, local_browser

async def main():
    browser = await local_browser.launch(headless=True)
    try:
        client = await Stagehand.create(
            browser=browser, model="openai/gpt-5.4-mini",
            model_api_key=os.environ["OPENAI_API_KEY"],
        )
        try:
            page = (await browser.context.pages())[0]
            await page.goto("https://example.com")
        finally:
            await client.close()
    finally:
        await browser.close()

asyncio.run(main())

SeleniumBase

Provides a framework for web crawling, scraping, and testing with pytest support.

Downloads / mo
1.2M
Last release
4.58.1
License
MIT

Quickstart

From method_summary.md
$ python3.11 -m pip install seleniumbase==4.58.1
from seleniumbase import SB

with SB() as browser:
    browser.open("https://example.com")

FAQ

Playwright suits new automation across Chromium, Firefox, and WebKit with automatic waiting. Selenium suits teams with existing WebDriver suites or grid infrastructure. Browser Use suits AI agents that operate a browser from natural-language tasks.

Playwright drives browsers through its own protocol and waits for elements automatically. Selenium drives browsers through the WebDriver standard and supports remote grids of many browser versions.

Browser Use is a browser agent built on Pydantic AI that drives Chrome over the DevTools Protocol. The browser-use-sdk package calls the hosted Browser Use cloud API instead.

Install Selenium, create a driver for a browser such as Chrome, and call its find and click methods on page elements. Selenium Manager downloads a matching browser driver automatically.

Install Playwright and run its install command to download browser builds. Scripts then launch a browser, open a page, and act on locators through the sync or async API.

SeleniumBase is a framework on top of Selenium for web crawling, scraping, and testing. It integrates with pytest and adds its own helper methods.

For coding agents

Found your browser automation library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official