关于 web-archive-scraper
一个通过 Internet Archive Wayback Machine 查找网站快照的 Python 命令行技能。它可筛选并去重结果,也能获取归档 HTML 并提取可读文本,无需 API 密钥。
主要功能
- 01按 URL 和匹配类型搜索快照
- 02按日期、状态码和 MIME 类型筛选
- 03按时间段去重快照
- 04获取归档 HTML 内容
- 05输出 JSON、CSV 或摘要
适用场景
- 01从旧网站恢复客户或合作伙伴名单
- 02在网站改版前找回客户评价
- 03追踪竞争对手宣传内容的变化
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ gooseworks-ai/ goose-skills --skill web-archive-scraper安装后在 Claude Code 中输入/web-archive-scraper确认已加载。
附带文件scripts/search_archive.pyskill.meta.json
详细介绍
网页存档抓取工具
在 Wayback Machine(Internet Archive)中搜索网站的存档快照。获取缓存的页面内容,以查找客户名单、客户评价、合作伙伴目录,以及其他来自已更改或关闭网站的信息。
快速开始
唯一的依赖项是 requests。无需 API 密钥。
# Find all snapshots of a URL
python3 skills/web-archive-scraper/scripts/search_archive.py \
--url "https://botkeeper.com/customers"
# Search with date range
python3 skills/web-archive-scraper/scripts/search_archive.py \
--url "https://botkeeper.com" --from 2025-01-01 --to 2026-02-01
# Search all pages under a domain (prefix match)
python3 skills/web-archive-scraper/scripts/search_archive.py \
--url "https://botkeeper.com" --match prefix --limit 50
# Fetch the actual archived page content
python3 skills/web-archive-scraper/scripts/search_archive.py \
--url "https://botkeeper.com/customers" --fetch
# Output formats
python3 skills/web-archive-scraper/scripts/search_archive.py --url URL --output json
python3 skills/web-archive-scraper/scripts/search_archive.py --url URL --output csv
python3 skills/web-archive-scraper/scripts/search_archive.py --url URL --output summary
工作原理
- CDX API 搜索 — 查询
web.archive.org/cdx/search/cdx,查找与 URL 匹配的快照 - 筛选 — 按日期范围、HTTP 状态码和 MIME 类型筛选
- 去重 — 默认每天只保留一个快照,以避免结果冗余
- 获取内容 — 可选获取原始存档 HTML(使用
id_修饰符跳过 Wayback 工具栏) - 提取文本 — 获取内容时去除 HTML 标签,输出易读文本
CLI 参考
| 标志 | 默认值 | 说明 |
|---|---|---|
--url | 必填 | 要在存档中搜索的目标 URL |
--match | exact | 匹配类型:exact、prefix、host、domain |
--from | none | 起始日期(YYYY-MM-DD) |
--to | none | 结束日期(YYYY-MM-DD) |
--limit | 25 | 返回的快照数量上限 |
--fetch | false | 获取并显示最新快照的内容 |
--fetch-all | false | 获取所有匹配快照的内容(请与较小的 --limit 一起使用) |
--status | 200 | HTTP 状态筛选条件(设置为 "any" 可包含所有状态) |
--output | json | 输出格式:json、csv、summary |
--collapse | day | 去重级别:none、day、month、year |
输出架构
{
"url": "https://botkeeper.com/customers",
"timestamp": "20250915143022",
"datetime": "2025-09-15T14:30:22",
"status_code": "200",
"mime_type": "text/html",
"archive_url": "https://web.archive.org/web/20250915143022/https://botkeeper.com/customers",
"raw_url": "https://web.archive.org/web/20250915143022id_/https://botkeeper.com/customers",
"content": "..."
}
仅在使用 --fetch 或 --fetch-all 时,才会填充 content 字段。
费用
免费。Wayback Machine CDX API 无需身份验证或 API 密钥。速率限制约为每分钟 15 个请求。
常见用例
- 查找已关闭公司的客户名单(例如 botkeeper.com)
- 在网站重新设计前找回客户评价/案例研究
- 追踪竞争对手的宣传信息如何随时间变化
- 查找已移除的合作伙伴目录
评论
支持 Markdown