Skip to main content

web-extract

Extract clean text content from any URL. Uses trafilatura for high-quality extraction, no API key needed.

소스 정보

저장소
fuyuxiang/echo-agent
최근 소스 활동
2026년 8월 2일 03:20
감지된 SKILL.md 언어
영어
스타
1,059
포크
27

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
web-extract
description
Extract clean text content from any URL. Uses trafilatura for high-quality extraction, no API key needed.
version
1.0.0
metadata
{"echo":{"tags":["Web","Extract","Scraping","Content","URL"]}}
# Web Extract Extract readable text/markdown from any URL. Uses trafilatura — the best Python content extraction library (handles news, blogs, docs reliably). ## Quick Usage ```bash pip install trafilatura httpx ``` ```python import trafilatura # Fetch and extract in one step text = trafilatura.fetch_and_extract("https://example.com/article") print(text) # With more options downloaded = trafilatura.fetch_url("https://example.com/article") result = trafilatura.extract(downloaded, output_format="markdown", include_links=True) ``` ### Helper script ```bash python3 scripts/extract_url.py "https://example.com/article" python3 scripts/extract_url.py "https://example.com" --format markdown --links ``` ## Options | Parameter | Effect | |-----------|--------| | `output_format="markdown"` | Markdown with headers | | `include_links=True` | Preserve hyperlinks | | `include_images=True` | Include image references | | `include_tables=True` | Preserve table structure | | `favor_recall=True` | Extract more (less precision) | ## Fallback: httpx + readability For pages where trafilatura struggles: ```python import httpx from readability import Document resp = httpx.get(url, follow_redirects=True, timeout=15) doc = Document(resp.text) title = doc.title() content = doc.summary() # HTML, needs html2text for markdown ``` ## JavaScript-heavy sites For SPAs or JS-rendered content, use playwright (optional): ```python from playwright.sync_api import sync_playwright with sync_playwright() as p: browser = p.chromium.launch() page = browser.new_page() page.goto(url, wait_until="networkidle") html = page.content() browser.close() # Then pass html to trafilatura.extract() ``` ## Rate Limits Be respectful: add 1-2 second delays between requests to the same domain. Set a User-Agent: `trafilatura.fetch_url(url, config=config)` with custom config.
GitHub에서 보기