Agent skill
extract-html
Extract structured JSON from HTML using Schematron3B, deterministic table extraction, and Vision-based media OCR.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/extract-html
SKILL.md
Extract-HTML Skill
A robust skill for converting HTML documents into strictly valid JSON based on a user-provided JSON Schema.
Capabilities
- Schema Compliance: Guarantees output conforms to the provided JSON Schema (using Schematron-3B + validation loop).
- Deterministic Tables: Extracts HTML tables using
pandas.read_htmland injects them as context, preventing hallucination of data. - Media Text Extraction: Identifies images, filters by pixel size, and optionally uses a Vision API (OpenAI-compatible) to extract text/OCR.
- Self-Correction: Validates model output and retries with error feedback if schema validation fails.
Usage
Basic Conversion (Local Only)
./run.sh convert \
--html input.html \
--schema target.schema.json \
--out result.json
Advanced (With Vision & Remote Fetch)
./run.sh convert \
--html input.html \
--schema target.schema.json \
--out result.json \
--fetch-remote-media \
--vision-api-base "https://glhf.chat/api/openai/v1" \
--vision-api-key "sk-..." \
--vision-model "gpt-4o-mini"
Options
--max-attempts <int>: Number of self-correction retries.--extract-tables / --no-extract-tables: Toggle deterministic table extraction.--extract-media-text: Enable image processing.--min-image-px,--max-image-px: Filter images by size.--include-sections: detailed H1-H6 hierarchy in context.
Dependencies
- Ollama running
schematron-3b(or compatible model). - Python 3.11+
- See
pyproject.tomlfor python deps.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?