Make Selenium undetectable with stealth evasions and Tor integration.
Project description
Sneaky Selenium 
Sneaky Selenium is a Python package designed to prevent Selenium from being detected. Its primary goal is to enhance Selenium's stealth capabilities ensuring smooth automation while bypassing detection systems. Currently supports Chrome and Remote WebDriver.
Project Lineage
This project has evolved through several maintainers:
- puppeteer-extra-plugin-stealth by berstend (2019) - The original JavaScript stealth plugin for Puppeteer
- selenium-stealth by diprajpatra (2020) - Python port for Selenium, now unmaintained
- stealthenium by markmelnic (2024) - Updated fork with fixes
- sneaky-selenium (2026) - Current version with modern evasions, Tor integration, and Python 3.13+ support
Features
- Passes public bot detection tests.
- Bypasses Cloudflare and other bot detection systems.
- Maintains a reasonable reCAPTCHA v3 score.
- Tor integration for anonymous browsing.
- Updated for 2026 with modern evasion techniques.
Installation
Available on PyPI:
pip install sneaky-selenium
For Tor support (optional):
pip install sneaky-selenium[tor]
Usage
from selenium import webdriver
from sneaky_selenium import stealth
import time
options = webdriver.ChromeOptions()
options.add_argument("start-maximized")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=options)
stealth(driver,
languages=["en-US", "en"],
vendor="Google Inc.",
platform="Win32",
webgl_vendor="Intel Inc.",
renderer="Intel Iris OpenGL Engine",
fix_hairline=True,
)
driver.get("https://bot.sannysoft.com/")
time.sleep(5)
driver.quit()
Tor Integration
Sneaky Selenium supports routing traffic through the Tor network for anonymous browsing.
Prerequisites
- Install Tor:
sudo pacman -S tor(Arch) /sudo apt install tor(Debian) /brew install tor(macOS) - Start Tor:
sudo systemctl start tor - Install with Tor support:
pip install sneaky-selenium[tor]
Quick Start with Tor
from sneaky_selenium import stealth_with_tor
# One-liner to create a stealthed browser routing through Tor
driver = stealth_with_tor()
driver.get("https://check.torproject.org")
driver.quit()
Custom Tor Configuration
from sneaky_selenium import stealth_with_tor, TorDriverConfig
config = TorDriverConfig(
socks_host="127.0.0.1",
socks_port=9050, # Default Tor port (9150 for Tor Browser Bundle)
headless=True,
additional_options=["--window-size=1920,1080"],
)
driver = stealth_with_tor(
config=config,
languages=["en-US", "en"],
platform="Win32",
)
driver.get("https://bot.sannysoft.com/")
driver.quit()
Utility Functions
from sneaky_selenium import (
is_tor_available,
check_tor_connection,
get_tor_exit_ip,
verify_tor_connection_via_driver,
)
# Check if Tor is running
if is_tor_available():
print("Tor is available!")
# Get connection info (requires requests[socks])
info = check_tor_connection()
print(f"Connected: {info['connected']}, IP: {info['ip']}, Is Tor: {info['is_tor']}")
# Verify via browser
result = verify_tor_connection_via_driver(driver)
print(result["message"])
API Reference
stealth(
driver: Driver,
user_agent: str | None = None,
languages: list[str] | None = ["en-US", "en"],
vendor: str = "Google Inc.",
platform: str | None = "Win32",
webgl_vendor: str = "Intel Inc.",
renderer: str = "Intel Iris OpenGL Engine",
fix_hairline: bool = False,
run_on_insecure_origins: bool = False,
device_memory: int = 8,
hardware_concurrency: int = 8,
)
License
This project is licensed under the MIT License. See the LICENSE file for details.
© 2019 berstend, 2020 diprajpatra, 2024 markmelnic, 2026 KaiErikNiermann
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sneaky_selenium-2.0.0.tar.gz.
File metadata
- Download URL: sneaky_selenium-2.0.0.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7b95ed48334e22237cc2ba8db6ba1873d15ff3bb438afe3b4438c4b6f781992
|
|
| MD5 |
02db66381fed617f042e324529376146
|
|
| BLAKE2b-256 |
df00f728ff78cfdb58b3e657c0330732d48b7ceaba1e6c3a00b45ea61cd1e3f4
|
Provenance
The following attestation bundles were made for sneaky_selenium-2.0.0.tar.gz:
Publisher:
publish.yaml on KaiErikNiermann/sneaky-selenium
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sneaky_selenium-2.0.0.tar.gz -
Subject digest:
e7b95ed48334e22237cc2ba8db6ba1873d15ff3bb438afe3b4438c4b6f781992 - Sigstore transparency entry: 844960552
- Sigstore integration time:
-
Permalink:
KaiErikNiermann/sneaky-selenium@59fc5ed3d5d5c259118b7d5b1f81159dca3dfb8e -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/KaiErikNiermann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@59fc5ed3d5d5c259118b7d5b1f81159dca3dfb8e -
Trigger Event:
release
-
Statement type:
File details
Details for the file sneaky_selenium-2.0.0-py3-none-any.whl.
File metadata
- Download URL: sneaky_selenium-2.0.0-py3-none-any.whl
- Upload date:
- Size: 41.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
069b15276d78f83ad96c1eb3ddb2c43baf8dabfe47019cf62e5a457e19382b80
|
|
| MD5 |
b388b779118acc0d694a762ad843f6cf
|
|
| BLAKE2b-256 |
b78d996c138278b652cb17feef26677ab015ae6c73fbd0019dc6b6beca0dced1
|
Provenance
The following attestation bundles were made for sneaky_selenium-2.0.0-py3-none-any.whl:
Publisher:
publish.yaml on KaiErikNiermann/sneaky-selenium
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sneaky_selenium-2.0.0-py3-none-any.whl -
Subject digest:
069b15276d78f83ad96c1eb3ddb2c43baf8dabfe47019cf62e5a457e19382b80 - Sigstore transparency entry: 844960554
- Sigstore integration time:
-
Permalink:
KaiErikNiermann/sneaky-selenium@59fc5ed3d5d5c259118b7d5b1f81159dca3dfb8e -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/KaiErikNiermann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@59fc5ed3d5d5c259118b7d5b1f81159dca3dfb8e -
Trigger Event:
release
-
Statement type: