闲社服务运行正常AI智能体自动化平台
a

亚马逊爬虫

技能标识:amazon-scraper

>

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 3.1.0
检测标记
后台标记通过
免费
免费获取
6
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

亚马逊爬虫

Amazon Scraper

Docker容器化爬虫,支持穿透反爬,三种模式自动识别(Amazon / YouTube / 通用网页)。

前置要求

  • - Docker 已安装并运行
  • 首次使用前构建镜像(在 skill 目录下执行):
bash docker build -t clawd-crawlee /path/to/amazon-scraper/
  • - 创建输出目录: mkdir -p ~/scrapes

模式选择规则

1. Amazon模式 (amazon_handler.js)

自动触发条件: URL包含 amazon.com,或用户提到亚马逊/Amazon/ASIN/BSR/选品/竞品/畅销榜/类目分析等关键词

根据URL自动识别页面类型:

URL特征页面类型可获取字段
/zgbs/ 或 /bestsellers/畅销榜rank, title, asin, price, rating, reviews, image, url
/zg/new-releases/
新品榜 | 同上 |
| /zg/movers-and-shakers/ | 飙升榜 | 同上 |
| /s?k= 或 /s/ | 搜索结果 | title, asin, price, rating, reviews, image, url, boughtPastMonth, sponsored |
| /dp/ 或 /gp/product/ | 产品详情 | title, asin, price, rating, reviews, brand, bsr, boughtPastMonth, dateFirstAvailable, category, bullets, details, image |

⚠️ 重要规则:

  • - Best Sellers页面没有月销量(boughtPastMonth)数据 — 亚马逊不在榜单页显示此信息
  • 要获取月销量,必须用搜索页(/s?k=关键词)或产品详情页(/dp/ASIN)
  • 如果用户同时需要排名+月销量,建议:先爬Best Sellers拿排名,再用搜索页补月销

bash

畅销榜(有排名,无月销)


docker run -t --rm clawd-crawlee node assets/amazon_handler.js https://www.amazon.com/zgbs/electronics

搜索结果(有月销,无排名)

docker run -t --rm clawd-crawlee node assets/amazon_handler.js https://www.amazon.com/s?k=feather+duster

产品详情(最全字段:BSR、品牌、卖点、月销)

docker run -t --rm clawd-crawlee node assets/amazon_handler.js https://www.amazon.com/dp/B001TQ6IHS

多页爬取

docker run -t --rm clawd-crawlee node assets/amazon_handler.js URL --pages 2

输出格式: JSON
json
{
status: SUCCESS,
type: bestsellers|search|product-detail,
category: 品类名,
totalProducts: 30,
scrapedAt: ISO时间,
products: [
{
rank: 1,
title: 产品名,
asin: B001TQ6IHS,
price: 9.94,
priceStr: $9.94,
rating: 4.6,
reviews: 20547,
boughtPastMonth: 1K+,
image: https://...,
url: https://...
}
]
}

2. YouTube模式 (main_handler.js)

自动触发条件: URL包含 youtube.com,或用户提到YouTube/视频字幕/转录/transcript
  • - 拦截网络请求捕获字幕API (timedtext)
  • 模拟点击展开描述和转录稿按钮
  • 输出: {status, type:TRANSCRIPT|DESCRIPTION, videoId, data}

bash
docker run -t --rm clawd-crawlee node assets/main_handler.js https://youtube.com/watch?v=xxx

3. 通用模式 (main_handler.js)

触发条件: 非Amazon、非YouTube的URL,或用户提到爬取/抓取任意网页/社交媒体
  • - Playwright打开页面,等待JS加载完成
  • 提取 document.body.innerText(纯文本,去广告噪音)
  • 输出上限10000字符
  • 输出: {status:SUCCESS, type:GENERIC, title, data}

bash
docker run -t --rm clawd-crawlee node assets/main_handler.js https://任意网址

Agent调用决策树

用户给了URL?
├─ 包含 amazon.com → 用 amazon_handler.js
│ ├─ 需要月销量? → 建议用搜索URL(/s?k=) 或详情页(/dp/)
│ └─ 需要排名? → 用畅销榜URL(/zgbs/)
├─ 包含 youtube.com → 用 main_handler.js (自动YouTube模式)
└─ 其他网站 → 用 main_handler.js (通用模式)

用户没给URL,只说了需求?
├─ 爬亚马逊XX品类Top / XX类目排行 / XX畅销榜 → 构造 https://www.amazon.com/zgbs/品类
├─ 搜亚马逊XX / XX关键词搜索 / 找XX产品 → 构造 https://www.amazon.com/s?k=关键词
├─ 分析某个ASIN / 看看这个产品 / XX的详情 → 构造 https://www.amazon.com/dp/ASIN
├─ XX的月销量 / XX卖了多少 / XX销量怎么样 → 用搜索页或详情页(有boughtPastMonth)
├─ 竞品分析 / 竞品调研 / 对手在卖什么 → 先搜索再逐个爬详情
├─ 选品 / 什么好卖 / 品类机会 / 市场调研 → Best Sellers + 搜索结合
└─ 其他 → 先web_search找到URL,再用对应模式爬

常见用户意图 → 操作映射

用户说操作
帮我看看亚马逊XX品类爬 /zgbs/品类 畅销榜
XX在亚马逊卖得怎么样
搜索 /s?k=XX 看月销 | | 分析一下这个ASIN: BXXXXXXXXX | 爬 /dp/ASIN 详情页 | | XX品类有什么机会 | 畅销榜 + 搜索 综合分析 | | 帮我爬这个链接 | 判断URL类型,选对应handler | | 这个YouTube视频讲了什么 | YouTube模式抓字幕 | | 帮我抓XX网站的内容 | 通用模式 | | 搜一下XX的竞品 | 搜索页爬取 + 分析 | | XX月销多少 / XX一个月卖多少 | 搜索页或详情页 | | 帮我看看top 100 / 热门产品 | Best Sellers畅销榜 | | 新品有哪些 / 最近上了什么新品 | /zg/new-releases/ | | 什么产品涨得快 / 飙升榜 | /zg/movers-and-shakers/ |

反爬能力

  • - 每次清除Cookie,模拟全新用户
  • Docker沙箱隔离,无指纹追踪
  • Playwright模拟真实浏览器行为
  • 自动滚动加载懒加载内容
  • 支持重试(maxRetries: 2)

数据输出模式(重要)

模式一:stdout 直接输出(适合单次抓取)

bash

单URL抓取,结果打印到终端

docker run --rm clawd-crawlee node assets/amazon_handler.js https://www.amazon.com/dp/ASIN

⚠️ 并行执行多个容器时,stdout 会交织混乱,导致数据丢失或解析错误。

模式二:文件输出(适合批量抓取)⭐ 推荐

bash

方式A:单次抓取写入文件

OUTDIR=~/scrapes && mkdir -p $OUTDIR docker run --rm clawd-crawlee node assets/amazon_handler.js URL > $OUTDIR/$(date +%s).json 2>&1

方式B:批量抓取(使用 scripts/batch-scrape.sh)

设置输出目录(可自定义)

export SCRAPE_DIR=~/scrapes

执行批量抓取(从 stdin 读 ASIN 列表)

cat asin-list.txt | bash /path/to/amazon-scraper/scripts/batch-scrape.sh

结果文件存于 $SCRAPE_DIR/{timestamp}.json

✅ 结果直接写文件,不走 stdout,完全避免输出混乱问题。

批量分析工作流

  1. 1. 爬取数据 -> 存文件到 ~/scrapes/
  2. 本地分析 -> Python 读文件做统计分析
  3. 结果进LLM -> 只把分析结论发给 AI,

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 amazon-scraper-1776270129 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 amazon-scraper-1776270129 技能

通过命令行安装

skillhub install amazon-scraper-1776270129

下载

⬇ 下载 amazon-scraper v3.1.0(免费)

文件大小: 14.37 KB | 发布时间: 2026-4-16 16:28

v3.1.0 最新 2026-4-16 16:28
amazon-scraper 3.1.0

- Added batch scraping support with the new `scripts/batch-scrape.sh` script, enabling efficient multi-ASIN processing and file-based result output.
- Expanded documentation: clarified batch and file output workflows, added best practices for large-scale/batch analysis, and described browser-based manual extraction methods.
- Updated output management section: strongly recommends direct-to-file output to avoid stdout mixing in multi-process scenarios.
- Enhanced guidance on DOM selectors and inline JS scripts for browser-assisted extraction.
- Minor optimizations and clarifications throughout documentation for a streamlined user experience.
返回顶部