html2json
A Rust port of cheerio-json-mapper.
Overview
- Input: HTML source (file path or stdin) + Extractor spec (JSON file)
- Output: JSON matching the structure defined in the spec
Installation
From crates.io
From source
# or from a git repository
Using just
Examples
# Extract from file
# Extract from stdin (pipe from curl)
|
# Extract from stdin (pipe from cat)
|
# Check output matches expected JSON (useful for testing/CI)
Options
--spec, -s <FILE>- Path to JSON extractor spec file (required)--check, -c <FILE>- Compare output against expected JSON file. Exits with 0 if match, 1 if differ (with colored diff).
LICENSE
MIT