_playwright/__init__.py

crawlee-python · src/crawlee/crawlers/_playwright/__init__.py · python · Apache-2.0
scraping, Scraping / Crawling

Exports Playwright crawler classes for headless browser automation and scraping.

# Source: https://github.com/apify/crawlee-python | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
from crawlee._utils.try_import import install_import_hook as _install_import_hook
from crawlee._utils.try_import import try_import as _try_import

_install_import_hook(__name__)

# The following imports are wrapped in try_import to handle optional dependencies,
# ensuring the module can still function even if these dependencies are missing.
with _try_import(__name__, 'PlaywrightCrawler', extra_name='playwright'):
    from ._playwright_crawler import PlaywrightCrawler
with _try_import(__name__, 'PlaywrightCrawlingContext', extra_name='playwright'):
    from ._playwright_crawling_context

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key