Skip to content

Capture examples

Start with a file capture, then use the matching memory example when your application needs bytes or progress events.

Save a page

console
offprint capture https://example.com --output example.html

The quickstart covers installation, opening the result, and inspecting its evidence.

Complete programs in each language create a service, capture the page, and close the service:

LanguageWrite a fileReturn bytes and observe eventsSetup
Rustcapture_file.rscapture_memory.rsRust integration
Node.jscapture.tscapture-memory.tsNode.js integration
Pythoncapture.pycapture_memory.pyPython integration

Adapt the capture

TaskExample
Capture the first matching articleSelector capture
Wait for data and rendered contentReadiness
Pass an authorization header or session cookieAuthenticated pages
Fail when a rendering resource is missingResource policy
Capture a local HTML fileAllowed file roots
Permit a controlled private networkCustom network rules
Export PDF, Markdown, or an archiveExport representations
Capture a list of URLs or follow linksBatch and crawl

Inspect preservation evidence

The repository also contains browser fixtures for script-rendered content, frames, shadow roots, stylesheets, form state, canvas pixels, resource failures, and offline verification. Each fixture has one executable test owner.

After contributor setup, run a named fixture from the repository root:

console
just test-fixture script-rendered-document

Browse the fixture catalog and testing guide to check a specific preservation contract or add a regression case.