爬取 Amazon 商品数据,支持关键词搜索,提取价格、评分、评论数,生成结构化 Excel 和 Markdown 报告,含品牌与爆款分析。
爬取 Amazon 商品数据,生成结构化报告(Markdown + Excel)。支持商品搜索、数据提取、品牌分析、爆款识别。
适用场景:
# 访问 ClawHub 页面
https://clawhub.ai/zuokun300/amazon-scraper
# 或使用 CLI 安装
clawhub install zuokun300/amazon-scraper
# 1. 克隆技能到 workspace
git clone https://github.com/zuokun300/amazon-scraper.git ~/.openclaw/workspace/skills/amazon-scraper
# 2. 安装依赖
pip3 install openpyxl requests --break-system-packages
# 3. 配置 Apify API Key
export APIFY_API_KEY="apify_api_xxxxx"
对 OpenClaw 说:
帮我爬取 Amazon 上的 "women fashion shoes",生成 Excel 报告
帮我爬取 Amazon 上的 "[关键词]",需要:
- 抓取前 50 个商品
- 提取价格、评分、评论数
- 生成 Excel 和 Markdown 报告
- 分析品牌分布
# 修改脚本中的参数
KEYWORDS = ["women fashion shoes", "men sneakers"]
MAX_PRODUCTS = 50
OUTPUT_DIR = "/path/to/output"
amazon-data.xlsx)包含两个 Sheet:
Sheet 1: 商品数据
| 列名 | 说明 |
|---|---|
| 排名 | 搜索排名 |
| 商品名称 | 完整标题 |
| 品牌 | 自动识别的品牌 |
| 类型 | 商品分类 |
| ASIN | Amazon 标准 ID |
| 价格 | 当前价格(需深度爬取) |
| 图片链接 | 可点击的主图链接 |
| Amazon 链接 | 可点击的商品页链接 |
Sheet 2: 统计摘要
amazon-report.md)包含:
获取方法:
配置方式:
# 方式 1:环境变量
export APIFY_API_KEY="apify_api_xxxxx"
# 方式 2:修改脚本
APIFY_TOKEN = "apify_api_xxxxx"
免费额度: $5(约 500-1000 次商品爬取)
openpyxl>=3.0.0
requests>=2.28.0
| 排名 | 商品 | 品牌 | 类型 | ASIN |
|---|---|---|---|---|
| 1 | adidas Women's VL Court 3.0 | Adidas | Sneaker | B0C2JY169J |
| 2 | Adokoo Women's Fashion Sneakers | Adokoo | Sneaker | B0CH9FJY8V |
| 3 | Adidas Women's Vl Court 3.0 | Adidas | Sneaker | B0F1XH7M8F |
| 品牌 | 商品数量 | 占比 |
|---|---|---|
| Adidas | 7 | 35% |
| ODOLY | 6 | 30% |
| LUCKY STEP | 5 | 25% |
# 启用深度爬取模式
python3 amazon_scraper.py --deep
额外数据:
# 配置 cron 每天执行
0 3 * * * python3 /path/to/amazon_scraper.py
用途:
KEYWORDS = [
"women fashion shoes",
"men sneakers",
"kids boots",
"running shoes"
]
A: 基础模式只抓取搜索页数据,价格需要访问商品详情页。使用 --deep 参数启用深度爬取。
A: 检查:
A: 修改 generate_excel() 和 generate_report() 函数,调整列名和样式。
最后更新:2026-03-03
ZIP package — ready to use