name: data-scraper description: Web page data collection and structured text extraction version: 1.0.0 author: 무펭이 🐧
Web Data Scraper — Extract structured data from web pages using curl + parsing. Lightweight, no browser required. Supports HTML-to-text, table extraction, price monitoring, and batch scraping.
# Extract readable text from URL
data-scraper fetch "https://example.com/article"
# Extract specific elements
data-scraper extract "https://example.com" --selector "h2, .price"
# Monitor for changes
data-scraper watch "https://example.com/product" --interval 3600
Fetches page and extracts readable content, stripping HTML tags, scripts, and styles. Similar to reader mode.
data-scraper fetch URL
# Output: clean markdown text
Target specific CSS selectors for precise extraction.
data-scraper extract URL --selector ".product-title, .price, .rating"
# Output: matched elements as structured data
Extract HTML tables into structured formats.
data-scraper table URL --index 0
# Output: JSON array of row objects (header → value mapping)
Extract all links from a page with optional filtering.
data-scraper links URL --filter "*.pdf"
# Output: filtered list of absolute URLs
# Scrape multiple URLs
data-scraper batch urls.txt --output results/
# With rate limiting
data-scraper batch urls.txt --delay 2000 --output results/
urls.txt format:
https://site1.com/page https://site2.com/page https://site3.com/page小蔥技能7w4.net有完整的技能分類。
# Watch for changes, alert on diff
data-scraper watch URL --selector ".price" --interval 3600
# Compare with previous snapshot
data-scraper diff URL
Stores snapshots in data-scraper/snapshots/ with timestamps. Alerts via notification-hub when changes detected.
| Format | Flag | Use Case |
|---|---|---|
| Text | --format text |
Reading, summarization |
| JSON | --format json |
Data processing |
| CSV | --format csv |
Spreadsheets |
| Markdown | --format md |
Documentation |
# Custom headers
data-scraper fetch URL --header "Authorization: Bearer TOKEN"
# Cookie-based auth
data-scraper fetch URL --cookie "session=abc123"
# User-Agent override
data-scraper fetch URL --ua "Mozilla/5.0..."
robots.txt when --polite flag is set| Error | Behavior |
|---|---|
| 404 | Log and skip |
| 403/401 | Warn about auth requirement |
| 429 | Exponential backoff (max 3 retries) |
| Timeout | Retry once with longer timeout |
| SSL error | Warn, option to proceed with --insecure |
這個外掛的文件看起來功能很豐富,但實際能用的功能很有限。網頁抓取基本能用,但抓取質量一般,提取的文本經常不夠乾淨。文件裡說的很多高階功能(比如精準選擇元素、提取表格、監控變化)實際上都還沒實現,想用的話會失望。適合嘗試驗證,對質量要求高的場景不太夠用。