All projects

ICCSafe Codebook → Unified PDF Scraper

Walks codes.iccsafe.org's premium viewer and exports every section to a single merged PDF via Playwright storage_state.

The challenge

Without Premium, generated PDFs say 'Printing is a feature of Digital Codes Premium'.

The solution

A single-CLI Playwright scraper that walks the sidebar tree, injects print-only CSS to strip nav/drawer/headers, calls page.pdf() per section, and merges with pypdf. Session reuse via --save-storage-state / --storage-state auth.json. Resumable via state.json.

Results

codes.iccsafe.org

Target

Per-section + merged PDF

Output

state.json resumable

Recovery