pydoll icon indicating copy to clipboard operation
pydoll copied to clipboard

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

Open thalissonvs opened this issue 4 months ago • 0 comments

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
  • 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.

thalissonvs avatar Aug 22 '25 05:08 thalissonvs