Skip to main content

A simple library to capture websites using playwright

Project description

Playwright Capture

Simple replacement for splash using playwright.

Install

pip install playwrightcapture

Note for Ubuntu 26.04 pre-1.61.0

It is not supported, and playwright install fails. A quick and dirty fix is

PLAYWRIGHT_HOST_PLATFORM_OVERRIDE=ubuntu24.04-x64 playwright install

Usage

A very basic example:

from playwrightcapture import Capture

async with Capture() as capture:
    await capture.initialize_context()
    entries = await capture.capture_page(url, max_depth_capture_time=90)

Entries is a dictionaries that contains (if all goes well) the HAR, the screenshot, all the cookies of the session, the URL as it is in the browser at the end of the capture, and the full HTML page as rendered.

reCAPTCHA bypass

No blackmagic, it is just a reimplementation of a well known technique as implemented there, and there.

This modules will try to bypass reCAPTCHA protected websites if you install it this way:

pip install playwrightcapture[recaptcha]

This will install requests, pydub and SpeechRecognition. In order to work, pydub requires ffmpeg or libav, look at the install guide for more details. SpeechRecognition uses the Google Speech Recognition API to turn the audio file into text (I hope you appreciate the irony).

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

playwrightcapture-1.40.0.tar.gz (31.8 kB view details)

Uploaded Source

Built Distribution

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

playwrightcapture-1.40.0-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file playwrightcapture-1.40.0.tar.gz.

File metadata

  • Download URL: playwrightcapture-1.40.0.tar.gz
  • Upload date:
  • Size: 31.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for playwrightcapture-1.40.0.tar.gz
Algorithm Hash digest
SHA256 2bef4e5af4d4538e59102ff83ea5eba9a6a49fd22d4d7196107a2bb0c98098a6
MD5 e0d3074d06935cc17f585e992a3a5dad
BLAKE2b-256 0b00d8a23e85310b303a28b81f2572775476fcfe4358d26be8cc2c3a278d0611

See more details on using hashes here.

Provenance

The following attestation bundles were made for playwrightcapture-1.40.0.tar.gz:

Publisher: release.yml on Lookyloo/PlaywrightCapture

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file playwrightcapture-1.40.0-py3-none-any.whl.

File metadata

File hashes

Hashes for playwrightcapture-1.40.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e105656ea1ffeba49b3cfd24e067cb2c759db79b92568d6ba71918b698f6f49
MD5 a733e9c49fd0953943f535a01cb54ebf
BLAKE2b-256 3c0b54cb057f779cd24f4c04c5b91db22122ae6b3e48f106fe8d6ecd6d4c307a

See more details on using hashes here.

Provenance

The following attestation bundles were made for playwrightcapture-1.40.0-py3-none-any.whl:

Publisher: release.yml on Lookyloo/PlaywrightCapture

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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