Anti-detection plugin for Playwright automation
Project description
Thespis
Make Playwright automation undetectable
Note: This project is currently in beta. Features are stable but may change based on feedback.
Why Use Thespis?
Websites detect Playwright because of navigator.webdriver and other automation signals.
Results: Tested against CreepJS:
| Metric | Real Browser | With Thespis | Without Thespis |
|---|---|---|---|
| Like Headless | 25% | 31% | 44% |
| Headless Detection | 0% | 0% | 33% |
Quick Start
Basic Example (Sync)
from playwright.sync_api import sync_playwright
from thespis import stealth_sync
with sync_playwright() as p:
# Launch browser with special flag (REQUIRED!)
browser = p.chromium.launch(
headless=False,
args=['--disable-blink-features=AutomationControlled']
)
# Create page and apply stealth
page = browser.new_page()
stealth_sync(page)
page.goto("https://bot.sannysoft.com")
page.screenshot(path="test.png")
browser.close()
Important: Required Flag
This flag is CRITICAL:
args=['--disable-blink-features=AutomationControlled']
Without it, navigator.webdriver stays true and detection fails.
Docker (Production)
For servers without displays, use Docker with Xvfb:
# Build image
docker-compose build
# Run test script
docker-compose run --rm thespis
# Run your own script
docker-compose run --rm thespis python your_script.py
Why Docker?
- Runs
headless=Falseon servers (31% detection score) - No visible windows (uses virtual display)
Recommended Full Configuration
# Launch browser
browser = p.chromium.launch(
headless=False,
args=[
'--disable-blink-features=AutomationControlled',
'--disable-dev-shm-usage',
'--no-sandbox',
]
)
# Create realistic context
context = browser.new_context(
viewport={'width': 1366, 'height': 768},
user_agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36',
locale='en-US',
timezone_id='America/New_York',
)
page = context.new_page()
stealth_sync(page)
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 thespis-0.1.0b1.tar.gz.
File metadata
- Download URL: thespis-0.1.0b1.tar.gz
- Upload date:
- Size: 77.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
894ff05e2500705b9e984c4ad9745d8021c1cb2c9f9c2250509296589fc20864
|
|
| MD5 |
d8d124d1a014c7c373d41e6ab41453a4
|
|
| BLAKE2b-256 |
011e1c0b5dddfe10e567f84980b56412f69cebbff174e817071f1e27839cd035
|
File details
Details for the file thespis-0.1.0b1-py3-none-any.whl.
File metadata
- Download URL: thespis-0.1.0b1-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2582e2b276d59f9c924c3942da130df005b6cbb913f682b7149e72fce65323c
|
|
| MD5 |
1c1f1b8de58c2b34a2b33d43a143cef8
|
|
| BLAKE2b-256 |
ea4e6beaefa06e003e0840e96f9619ca8c830cf098f51cc8633e960ab8aae101
|