Skip to content
Back to skills

Extract Html

ASecurity

Extract structured JSON from HTML using Schematron3B, deterministic table extraction, and Vision-based media OCR.

  • 6 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 11, 2026
ai-agentspythonbashapi

Works with

  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add grahama1970/agent-skills --skill extract-html --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Extract Html?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Extract Html
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/grahama1970-extract-html/badge)](https://www.skillsdirectory.com/skills/grahama1970-extract-html)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: extract-html
description: Extract structured JSON from HTML using Schematron3B, deterministic table extraction, and Vision-based media OCR.
triggers:
  - extract html
  - html to json
  - scrape html
  - table extraction
provides:
  - extract-html
composes:
  - task-monitor
  - agentic-evals
disciplines:
  - extraction
---

# Extract-HTML Skill

A robust skill for converting HTML documents into strictly valid JSON based on a user-provided JSON Schema.

## Capabilities

1.  **Schema Compliance**: Guarantees output conforms to the provided JSON Schema (using Schematron-3B + validation loop).
2.  **Deterministic Tables**: Extracts HTML tables using `pandas.read_html` and injects them as context, preventing hallucination of data.
3.  **Media Text Extraction**: Identifies images, filters by pixel size, and optionally uses a Vision API (OpenAI-compatible) to extract text/OCR.
4.  **Self-Correction**: Validates model output and retries with error feedback if schema validation fails.

## Usage

### Basic Conversion (Local Only)

```bash
./run.sh convert \
  --html input.html \
  --schema target.schema.json \
  --out result.json
```

### Advanced (With Vision & Remote Fetch)

```bash
./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.toml` for python deps.

Files in this skill

  • SKILL.md1.9 KB
  • extract_html/__init__.py142 B
  • extract_html/cleaning.py2.2 KB
  • extract_html/cli.py4.9 KB
  • extract_html/extract.py1.3 KB
  • extract_html/media.py6.8 KB
  • extract_html/normalize.py533 B
  • extract_html/pipeline.py10.3 KB
  • extract_html/schematron.py4.7 KB
  • extract_html/sectionify.py1.4 KB
  • extract_html/tables.py1.2 KB
  • extract_html/util.py706 B
  • extract_html/validate.py943 B
  • extract_html/vision_client.py4.4 KB
  • fixtures/agentic_eval.json490 B
  • pyproject.toml424 B
  • run.sh1022 B
  • sanity.sh2.9 KB
  • sanity/debug/attempt_01/cleaned.html233 B
  • sanity/verify.py3.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.