agentleFS
opendatahub-ioopendatahub-io/docs-skills/skills/article-extractor/SKILL.md

article-extractor

Skill4 starsChanged 4 months agoApache-2.0View on GitHub

Download HTML from websites and extract article content, removing HTML bloat. Specifically designed to extract content from <article> tags with aria-live="polite" attribute. Outputs clean, readable content for documentation sites like Red Hat docs.

  • Installs packages

9 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use webapp-testing, brainstorming and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • JetBrainsSkill

    webapp-testing

    Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

    Also in 3 projects that use this

  • OpenAISkill

    brainstorming

    You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

    Also in 3 projects that use this

  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Clean Output: Remove unnecessary HTML bloat and format for readability

    line 16
  2. Distinctive:

    No rate limiting by default (respect target site's robots.txt)

    line 110
  3. Distinctive:

    Only works with publicly accessible URLs (no authentication support)

    line 115

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Article Extractor Skill

This skill downloads HTML from websites and extracts the article content, removing unnecessary HTML bloat. It's particularly useful for documentation websites that have large amounts of navigation, styling, and other non-content HTML.

Capabilities

  • Download HTML: Fetch HTML content from any publicly accessible URL
  • Extract Article Content: Locate and extract content from <article> tags
  • Clean Output: Remove unnecessary HTML bloat and format for readability
  • Multiple Output Formats: Support for HTML, Markdown, and plain text output
  • Flexible Matching: Find article tags by various attributes (aria-live, class, id)

Usage

The skill uses a Python script that downloads and parses HTML content.

Basic Usage

Extract article from a URL:

uv run --script ${CLAUDE_SKILL_DIR}/scripts/article_extractor.py --url "https://example.com/page"

Extract with specific output format:

uv run --script ${CLAUDE_SKILL_DIR}/scripts/article_extractor.py --url "https://example.com/page" --format markdown

Save to file:

uv run --script ${CLAUDE_SKILL_DIR}/scripts/article_extractor.py --url "https://example.com/page" --output article.md

Extract with custom article selector:

uv run --script ${CLAUDE_SKILL_DIR}/scripts/article_extractor.py --url "https://example.com/page" --selector "article.main-content"

Command Line Options

  • --url URL: The URL to fetch HTML from (required)
  • --format {html,markdown,text}: Output format (default: markdown)
  • --output FILE: Save output to file instead of stdout
  • --selector SELECTOR: CSS selector for article content (default: article[aria-live="polite"])
  • --pretty: Pretty-print HTML output with indentation
  • --strip-links: Remove all hyperlinks from output

Output Formats

HTML (default): Extracts the article HTML content with all tags preserved but removes surrounding bloat.

Markdown: Converts the article content to Markdown format for easy reading and documentation.

Plain Text: Strips all HTML tags and returns plain text content.

Examples

Red Hat Documentation

# Extract from Red Hat OpenShift Lightspeed documentation
uv run --script ${CLAUDE_SKILL_DIR}/scripts/article_extractor.py \
  --url "https://docs.redhat.com/en/documentation/red_hat_openshift_lightspeed/1.0/html/install/ols-installing-lightspeed" \
  --format markdown \
  --output openshift-lightspeed-install.md

Generic Documentation Site

# Extract from any site with article tags
uv run --script ${CLAUDE_SKILL_DIR}/scripts/article_extractor.py \
  --url "https://example.com/docs/guide" \
  --selector "article.documentation" \
  --format text

Dependencies

This skill requires the following Python packages:

  • requests: For downloading HTML content
  • beautifulsoup4: For parsing and extracting HTML
  • html2text: For converting HTML to Markdown (optional, for markdown format)

Install dependencies:

python3 -m pip install requests beautifulsoup4 html2text

Use Cases

  1. Documentation Archival: Extract and save documentation pages for offline reading
  2. Content Migration: Extract article content for migration to different platforms
  3. Clean Reading: Get rid of navigation, ads, and other distractions
  4. Content Analysis: Extract main content for text analysis or processing
  5. Markdown Conversion: Convert HTML documentation to Markdown format

Performance

The skill downloads and processes HTML efficiently:

  • Single page extraction: ~1-3 seconds depending on page size and network
  • No rate limiting by default (respect target site's robots.txt)
  • Memory efficient streaming for large pages

Limitations

  • Only works with publicly accessible URLs (no authentication support)
  • Requires the target page to use <article> tags or similar semantic HTML
  • JavaScript-rendered content may not be extracted (uses static HTML only)
  • Some complex HTML structures may not convert perfectly to Markdown

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.