Smart Scraper
Intelligent web scraping that understands page structure.
Features
- - Auto-detection: Automatically identifies list, article, or table layouts
- Smart extraction: Parses prices, dates, URLs from unstructured text
- Multiple formats: Output as JSON, CSV, or Markdown
- Scroll support: Handles infinite scroll pages
Usage
CODEBLOCK0
Options
| Option | Description | Default |
|---|
| INLINECODE0 | Target URL (required) | - |
| INLINECODE1 |
Extraction type:
list,
article,
table,
auto |
auto |
|
--format, -f | Output format:
json,
csv,
markdown |
json |
|
--max, -m | Maximum items to extract | 100 |
|
--scroll | Enable auto-scroll for lazy-loaded content | false |
Examples
Extract Hacker News
CODEBLOCK1
Save article as Markdown
CODEBLOCK2
Export table to CSV
CODEBLOCK3
Smart Scraper
智能网页抓取工具,能够理解页面结构。
特性
- - 自动检测:自动识别列表、文章或表格布局
- 智能提取:从非结构化文本中解析价格、日期和URL
- 多格式输出:支持JSON、CSV或Markdown格式
- 滚动支持:处理无限滚动页面
使用方法
bash
提取产品列表
smart-scraper --url https://example.com/products --type list
提取文章内容
smart-scraper --url https://example.com/article --type article --format markdown
提取表格数据
smart-scraper --url https://example.com/data --type table --format csv
选项
| 选项 | 描述 | 默认值 |
|---|
| --url, -u | 目标URL(必填) | - |
| --type, -t |
提取类型:list、article、table、auto | auto |
| --format, -f | 输出格式:json、csv、markdown | json |
| --max, -m | 最大提取数量 | 100 |
| --scroll | 启用自动滚动以加载延迟内容 | false |
示例
提取Hacker News
bash
smart-scraper -u https://news.ycombinator.com -t list -m 10
将文章保存为Markdown
bash
smart-scraper -u https://blog.example.com/post -t article -f markdown > article.md
将表格导出为CSV
bash
smart-scraper -u https://example.com/prices -t table -f csv > prices.csv