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.htmlThe 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:
| Language | Write a file | Return bytes and observe events | Setup |
|---|---|---|---|
| Rust | capture_file.rs | capture_memory.rs | Rust integration |
| Node.js | capture.ts | capture-memory.ts | Node.js integration |
| Python | capture.py | capture_memory.py | Python integration |
Adapt the capture
| Task | Example |
|---|---|
| Capture the first matching article | Selector capture |
| Wait for data and rendered content | Readiness |
| Pass an authorization header or session cookie | Authenticated pages |
| Fail when a rendering resource is missing | Resource policy |
| Capture a local HTML file | Allowed file roots |
| Permit a controlled private network | Custom network rules |
| Export PDF, Markdown, or an archive | Export representations |
| Capture a list of URLs or follow links | Batch 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-documentBrowse the fixture catalog and testing guide to check a specific preservation contract or add a regression case.