| name | data-scraper |
| description | Extract data from websites, APIs, and files. Supports structured extraction, pagination, and anti-bot bypass. |
| triggers | ["scrape website","爬虫","extract data","web scraping"] |
Data Scraper
Extract data from websites, APIs, and files.
Features
- 🌐 Web Scraping — Extract from any website
- 📡 API Scraping — GET/POST requests
- 📄 File Parsing — CSV, Excel, PDF, JSON
- 🔄 Pagination — Auto-handle paginated content
- 🛡️ Anti-bot — Bypass protection
- 📊 Data Cleaning — Clean extracted data
Usage
Scrape Website
hermes scrape "https://example.com/products" \
--selector ".product-item" \
--fields name,price,image
hermes scrape "https://example.com/products" \
--selector ".product" \
--fields name,price \
--pages 10
Extract from API
hermes scrape-api "https://api.example.com/data" \
--headers "Authorization: Bearer TOKEN" \
--output data.json
File Parsing
hermes scrape file data.csv --format json
hermes scrape file report.xlsx --sheet "Sales"
hermes scrape file document.pdf --extract text
Configuration
scraping:
delay: 1000
retries: 3
timeout: 30
anti_bot:
rotate_user_agent: true
use_proxy: false
bypass_cloudflare: true
output:
format: json
encoding: utf-8
Extractors
CSS Selector
hermes scrape --selector ".product .title" --attr text
hermes scrape --selector "img.product" --attr src
JSON Path
hermes scrape-json --path "$.data[*].name" --file data.json
XPath
hermes scrape --xpath "//div[@class='product']/span" --file page.html
Pitfalls
- Legal Issues — Check robots.txt and terms of service
- Rate Limits — Don't overload servers
- Data Quality — Verify extracted data accuracy
- Anti-bot — Some sites block scrapers