Skip to main content

Webscrapehelper

A lightweight Playwright helper that opens a headed browser and records the HTML source (plus metadata) for each page you visit until the browser window is closed.

Features

  • Launches Chromium (or another Playwright browser) in headed mode so you can browse manually.
  • Collects page HTML, title, URL, HTTP status, and file size whenever the main frame navigates.
  • Saves snapshots to disk (session_log.jsonl + individual .html files) and keeps an in-memory list for immediate post-run use.
  • Returns a SessionResult with helpers such as .html_list and .html_snapshots.
  • Optional callback hook so your code can react to each captured event in real time.
  • Lets you write HTML files to a custom directory via html_output_dir.

Requirements

  • Python 3.9+
  • Playwright (pip install playwright and run playwright install once to fetch browser binaries).

Local installation

pip install -e .
playwright install

Quick start

import asyncio
from webscrapehelper import SessionRecorder

async def main():
    recorder = SessionRecorder(output_dir="session_data", headless=False)
    result = await recorder.run()
    print(f"Captured {len(result.html_list)} snapshots")
    if result.html_list:
        first_html = result.html_list[0]
        print(first_html[:200])  # preview

if __name__ == "__main__":
    asyncio.run(main())

Browse as usual; the script exits after you close the Playwright browser. Captured snapshots live in session_data/, and the returned SessionResult keeps the HTML in memory. To persist the HTML elsewhere, pass html_output_dir="C:/some/folder" when creating the recorder.

See examples/record_session.py for a slightly richer example that logs each event.

Metadata

Release files for webscrapehelper 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webscrapehelper 0.1.0
File Size Uploaded Provenance
webscrapehelper-0.1.0.tar.gz 8.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for webscrapehelper 0.1.0
File Interpreter ABI Platform
webscrapehelper-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.0 kB

Release files / webscrapehelper-0.1.0.tar.gz

Download URL webscrapehelper-0.1.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
befe89e9c237106191c682104b5b69b73d65856ef595a0974a6b7168a1d8efec
BLAKE2b-256 checksum
How to use checksums
bed84f0fff585cef0a554840d68db3752caa28816d43057718a41277d2c4ee80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / webscrapehelper-0.1.0-py3-none-any.whl

Download URL webscrapehelper-0.1.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8db49bb8b1a5b722cda464c71737870ced9cfa026e03639cb87ee89440bbb59b
BLAKE2b-256 checksum
How to use checksums
8652e20a69dcce38590b35064eca75ca0671f7ca33da97d0678afffd18b38a95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Security for webscrapehelper 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page