---
name: "trafilatura-web-content-extractor"
description: "Extract core article text, metadata, and comments from web pages with peak precision."
metadata:
  author: "Adrien Barbaresi"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "extract main article text trafilatura"
  - "strip boilerplate from web page"
  - "extract article metadata python"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Trafilatura Precision Web Article Text Extractor

Extracts primary web content using Trafilatura: removing navigation bars, sidebars, cookie banners, and footers while preserving article text, author metadata, publication dates, and clean formatting.

## When to Invoke
Invoke this skill whenever you need to:
- extract main article text trafilatura
- strip boilerplate from web page
- extract article metadata python

## Execution SOP & Rules
1. Extract primary text with text = trafilatura.extract(downloaded_html).
2. Extract structured metadata with metadata = trafilatura.extract_metadata(downloaded_html).
3. Configure include_comments=False and include_tables=True based on downstream requirements.
4. Fallback to readability heuristics if Trafilatura returns empty text on unconventional layouts.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
