playwright stealth
Project description
playwright_stealth
Transplanted from puppeteer-extra-plugin-stealth, Not perfect.
Install
$ pip install playwright-stealth
Usage
sync
from playwright import sync_playwright
from playwright_stealth import stealth_sync
with sync_playwright() as p:
for browser_type in [p.chromium, p.firefox, p.webkit]:
browser = browser_type.launch()
page = browser.new_page()
stealth_sync(page)
page.goto('http://whatsmyuseragent.org/')
page.screenshot(path=f'example-{browser_type.name}.png')
browser.close()
async
# -*- coding: utf-8 -*-
import asyncio
from playwright import async_playwright
from playwright_stealth import stealth_async
async def main():
async with async_playwright() as p:
for browser_type in [p.chromium, p.firefox, p.webkit]:
browser = await browser_type.launch()
page = await browser.new_page()
await stealth_async(page)
await page.goto('http://whatsmyuseragent.org/')
await page.screenshot(path=f'example-{browser_type.name}.png')
await browser.close()
asyncio.get_event_loop().run_until_complete(main())
Test results
playwright without stealth
playwright with stealth
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
playwright-stealth-1.0.5.tar.gz
(19.1 kB
view details)
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 playwright-stealth-1.0.5.tar.gz.
File metadata
- Download URL: playwright-stealth-1.0.5.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28839cc2da803a156161799007922ccc60e839bb45c76df2a1b411471bfb1b7a
|
|
| MD5 |
b012f376328d40fe41ec3f6795ca329d
|
|
| BLAKE2b-256 |
ee301a14df1b3ff5d36925e244563b1ebe3ef0e753689437a957bf90e7b11509
|
File details
Details for the file playwright_stealth-1.0.5-py3-none-any.whl.
File metadata
- Download URL: playwright_stealth-1.0.5-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64c2eca6b62485604aa68dfc12d4b1ea2d882ab0c5b3f24ca9d50dc3d78c638f
|
|
| MD5 |
9c977641d803ffb0432e7b0023825b96
|
|
| BLAKE2b-256 |
b95ce30a84b05a321e0c6602094f9a40183a9c95a3f75cde3eb9d438f53eb750
|