Pre-release
This release is a pre-release and may not be stable for production use.
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)
Release files for thespis 0.1.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| thespis-0.1.0b1.tar.gz | 77.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| thespis-0.1.0b1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 96.0 kB
Release files / thespis-0.1.0b1.tar.gz
| Download URL | thespis-0.1.0b1.tar.gz |
|---|---|
| Size | 77.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
894ff05e2500705b9e984c4ad9745d8021c1cb2c9f9c2250509296589fc20864
|
|
BLAKE2b-256 checksum How to use checksums |
011e1c0b5dddfe10e567f84980b56412f69cebbff174e817071f1e27839cd035
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / thespis-0.1.0b1-py3-none-any.whl
| Download URL | thespis-0.1.0b1-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2582e2b276d59f9c924c3942da130df005b6cbb913f682b7149e72fce65323c
|
|
BLAKE2b-256 checksum How to use checksums |
ea4e6beaefa06e003e0840e96f9619ca8c830cf098f51cc8633e960ab8aae101
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|