web_index
Reads a site's sitemap, inventories page URLs, and compares them with the previous snapshot to report added, changed, unchanged, and removed entries.
Instructions
读取站点的 sitemap,清点页面 URL 并与上次的清单对比。
入口优先取 robots.txt 里的 Sitemap:,没有就回退 /sitemap.xml;
sitemap index 会递归展开(最多 20 个文件、2 层),支持 .gz 压缩包。
清单存到 DATA_DIR/index/<host>.json,下次返回新增 / 变更 / 未变 / 移除的计数与 URL。
Args: url: 站点根或任意页面 URL(按 host 找 sitemap);也可直接给 sitemap 地址。 include: 只保留 URL 匹配该正则的条目;不传不过滤。 exclude: 排除 URL 匹配该正则的条目;不传不排除。 limit: 本次最多处理多少条 URL(默认 1000,硬上限 5000)。 check_content: True 时对 lastmod 变过的条目回抓正文并比哈希,内容真没变的不算 changed (单次最多回抓 20 个,避免把站点打穿)。 dry_run: True 时只对比、不写入本次清单(便于先预览)。 reset: 丢弃旧清单并重建基线(本次返回 first_seen=true)。 session: 回抓正文时使用的登录态会话名(默认 default)。 deadline_ms: 整次调用的总预算(毫秒),不传表示不限;预算耗尽后不再展开新 sitemap。 proxy: 本次所有请求共用的代理;不传则按代理池分配,未配池时沿用全局配置。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| limit | No | ||
| proxy | No | ||
| reset | No | ||
| dry_run | No | ||
| exclude | No | ||
| include | No | ||
| session | No | default | |
| deadline_ms | No | ||
| check_content | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |