Skip to main content

A wrapper for scrapy-playwright with stealth features.

Project description

scrapy-playwright-stealth: Playwright integration for Scrapy with stealth features 🥷🏻

scrapy-playwright-stealth is a minimal extension of scrapy-playwright that integrates stealth features via tf-playwright-stealth.

This package simplifies the use of browser automation stealth techniques with Scrapy. It automatically applies the spoofing methods provided by tf-playwright-stealth to every page managed by scrapy-playwright.

Installation

pip install scrapy-playwright-stealth

In case you haven't installed the browsers for playwright before, you will also need to run:

playwright install

Activation

Replace the default http and/or https Download Handlers through DOWNLOAD_HANDLERS in settings.py:

# settings.py
DOWNLOAD_HANDLERS = {
    "http": "scrapy_playwright_stealth.handler.ScrapyPlaywrightStealthDownloadHandler",
    "https": "scrapy_playwright_stealth.handler.ScrapyPlaywrightStealthDownloadHandler",
}

The download handler enables the stealth features by default. You can pass PLAYWRIGHT_USE_STEALTH=False in settings.py to deactivate it. In this case the package will behave exactly as scrapy-playwright behaves.

Usage

Refer to the scrapy-playwright documentation.

Results

From bot.sannysoft.com

Headless Headful
Stealth Headless Headful
No Stealth Headless Headful

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrapy_playwright_stealth-0.1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scrapy_playwright_stealth-0.1.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file scrapy_playwright_stealth-0.1.1.tar.gz.

File metadata

File hashes

Hashes for scrapy_playwright_stealth-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b1ae5b364f7c733b75aed6e39428ea6d7924f0ff673cd8f667504f53e6f0de3d
MD5 725819944fccbfaed69d158fa263ea46
BLAKE2b-256 e1b619960db6342048240a8fbd782253348727340ec6d31f1f01f59b438f7ec8

See more details on using hashes here.

File details

Details for the file scrapy_playwright_stealth-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for scrapy_playwright_stealth-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f5153935b8d0ef7a544867fe7675e2f5456a24fc2e885070b02ebbeb4576c416
MD5 a509ae7190bd4772e7f2d133ab187f5f
BLAKE2b-256 221ee9b73013d7f017edd959ad6d87660d49ae5c4c94d1a8d005b07caad28fe7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page