What is SeleniumBase?
SeleniumBase is an open-source Python framework that brings web testing, web crawling, scraping, and stealth automation together in one tool. You write Python scripts that drive a real Chromium browser, and the framework handles the setup, waiting, and driver management for you. It sits in the Web Scraping & Crawling category of the Data & Labeling tools and is open-source, written in Python and licensed MIT.
Overview
SeleniumBase is an open-source Python framework that brings web testing, web crawling, scraping, and stealth automation together in one tool. You write Python scripts that drive a real Chromium browser, and the framework handles the setup, waiting, and driver management for you.
It runs on top of Selenium WebDriver and adds higher-level methods so your code stays short and readable. Most scripts can be run with pytest, pynose, or plain python, and a stealthy CDP Mode lets your browser sessions pass common bot-detection tests on sites that block normal automation.
What it does
- CDP Mode: a stealthy Chromium automation mode that bypasses common bot-detection systems
- Stealthy Playwright Mode that connects Playwright to a SeleniumBase browser session
- High-level Python methods (open, find_elements, assert_element, and more) that reduce boilerplate over raw Selenium
- Runs the same tests with pytest, pynose, or pure python, plus a Gherkin/behave BDD format
- Command-line tools via the seleniumbase / sbase commands, including project scaffolding with sbase mkdir
- Test reporting extras like HTML reports, a dashboard, screenshots, and a demo mode for visual stepping
Getting started
SeleniumBase installs from PyPI with pip. Install the package, verify the command-line tool, then run a script with pytest or pure Python.
Install SeleniumBase
Install the main framework from PyPI. Add Playwright too if you want the Stealthy Playwright integration.
pip install seleniumbase
pip install playwrightVerify the install
Type seleniumbase or sbase to confirm the framework installed correctly and to see the available commands.
sbase --helpRun a stealthy CDP Mode script
Pure CDP Mode (sb_cdp) opens a stealthy Chromium browser. This short script navigates to a bot-detection page and then quits.
from seleniumbase import sb_cdp
sb = sb_cdp.Chrome()
sb.goto("https://browserscan.net/bot-detection")
sb.sleep(3)
sb.quit()Run a test with pytest
Tests built on the BaseCase class run through pytest. Use the --demo flag to step through the actions visually.
pytest my_first_test.py --demoCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Write end-to-end UI tests for web apps and run them with pytest, with HTML reports and a dashboard
- Scrape data from pages, such as collecting listing titles and links into a Python list
- Crawl sites protected by bot-detection using the stealthy CDP Mode browser
- Connect Playwright to a stealthy SeleniumBase session for automation that needs to look like a real user
How SeleniumBase compares
SeleniumBase alongside other open-source web scraping & crawling tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Firecrawl | ★ 214k | A crawling service and API that converts whole websites into clean Markdown or structured JSON ready for LLMs. |
| Agent Reach | ★ 116k | A capability layer that installs, health-checks and routes readers so a CLI agent can read and search web pages, YouTube, RSS, GitHub, Reddit, Twitter/X and more without API fees. |
| Scrapling | ★ 107k | A Python web scraping framework whose parser relocates your elements when pages change, with stealthy fetchers and a Scrapy-like spider engine for full crawls. |
| Crawl4AI | ★ 88.2k | A local-first Python web crawler that turns pages into clean Markdown for use in RAG and LLM pipelines. |
| Scrapy | ★ 65.7k | A mature Python framework for writing fast spiders that crawl websites and extract structured data at scale. |
| changedetection.io | ★ 36.1k | A self-hosted web page change monitor with XPath/CSS/jq filters, browser steps and restock alerts, which can route every diff through an LLM to suppress noise. |
| ScrapeGraphAI | ★ 33k | A Python library that uses LLMs and a graph pipeline to extract data from pages based on natural-language prompts. |
| SeleniumBase | ★ 13.3k | All-in-one Python browser automation for testing, scraping, and stealth crawling |

