Skip to content

[Feature]: Page Bundle Snapshot (tab.save_bundle()) #245

@thalissonvs

Description

@thalissonvs

Currently, if a user wants to save a page for offline use, they need to manually fetch HTML, download assets, and rewrite links. This is verbose and error-prone.

We should introduce a method tab.save_bundle() that captures the current page and all of its assets (HTML, CSS, JS, images, fonts) into a single bundle for offline viewing. The output is a bundle.zip containing an index.html with all URLs rewritten to point to local paths.

Proposed API

await tab.save_bundle(path="bundle.zip", inline_assets: bool = False)
  • If inline_assets=True, resources are embedded directly (Base64 or <style>/<script> tags).
  • If inline_assets=False, assets are stored as separate files inside the bundle, and src/href are rewritten accordingly.

This gives users a “save as web archive” equivalent directly in Pydoll, useful for archiving, dataset creation, or debugging websites offline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfuture planningIdeas or features proposed for future development.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions