Fork of https://github.com/AtuboDad/playwright_stealth
Project description
playwright_stealth
Transplanted from puppeteer-extra-plugin-stealth, Not perfect.
Install
$ pip install playwright-stealth
Usage
sync
from playwright.sync_api 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.async_api 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 with stealth
playwright without 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
Built Distribution
Close
Hashes for tf-playwright-stealth-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65ddb51cc7304d2a1ce6257c2d23855a2428bb13669b090dd8496e5f7dc05c8f |
|
MD5 | 5b4e588c9bd7005bcc62119b4b82aebb |
|
BLAKE2b-256 | f4697fb03b79955839eddf64fba63072c5f7f2751511c810aa482d5b10f557fa |
Close
Hashes for tf_playwright_stealth-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e69fb50a7b8bc3eb3048b7dd17e41fd51edceef2e77e7372bc7ed571a2745ea9 |
|
MD5 | 221c7b9f561a6946dd498f9292b48652 |
|
BLAKE2b-256 | c8f5792835b025dc5e2e33bdb6f675d906dc0421fd6c3dfadcba9abda346f708 |