https://github.com/tinyfish-io/tf-playwright-stealth
A fork of https://github.com/AtuboDad/playwright_stealth
https://github.com/tinyfish-io/tf-playwright-stealth
Last synced: about 1 year ago
JSON representation
A fork of https://github.com/AtuboDad/playwright_stealth
- Host: GitHub
- URL: https://github.com/tinyfish-io/tf-playwright-stealth
- Owner: tinyfish-io
- License: mit
- Created: 2024-03-07T06:35:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-09T17:05:33.000Z (about 1 year ago)
- Last Synced: 2025-05-09T17:49:03.542Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 2.7 MB
- Stars: 90
- Watchers: 6
- Forks: 13
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# 🥷🏻 tf-playwright-stealth [](https://pypi.org/project/tf-playwright-stealth/) [](https://agentql.com) [](https://discord.gg/agentql)
> Transplanted from [puppeteer-extra-plugin-stealth](https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-stealth).
This is a package that makes playwright stealthy like a ninja by spoofing browser features in order to reduce the chance of detection.
## Install
```
pip install tf-playwright-stealth
```
## Usage
### sync
```python
from playwright.sync_api import sync_playwright
from playwright_stealth import stealth_sync
with sync_playwright() as p:
browser = p.chromium.launch(
headless=True,
)
page = browser.new_page()
stealth_sync(page)
page.goto("https://bot.sannysoft.com/")
page.screenshot(path=f"example_with_stealth.png", full_page=True)
browser.close()
```
### async
```python
from playwright.async_api import async_playwright
from playwright_stealth import stealth_async
with async_playwright() as p:
browser = await p.chromium.launch(
headless=True,
)
page = await browser.new_page()
await stealth_async(page)
await page.goto("https://bot.sannysoft.com/")
await page.screenshot(path=f"example_with_stealth_async.png", full_page=True)
await browser.close()
```
## Results
From [bot.sannysoft.com](https://bot.sannysoft.com/)
| Headless | Headful |
|----------|---------|
|  |  |