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

智能网页抓取

技能标识:smart-web-scraper

Extract structured data from any web page. Supports CSS selectors, auto-detection of tables and lists, JSON/CSV output formats. Use when asked to scrape a website, extract data from a page, pull product info, gather contact details, or collect listings from a URL.

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

智能网页抓取

智能网页抓取器

将网页中的结构化数据提取为干净的JSON或CSV格式。

快速开始

bash

抓取页面,提取所有文本内容


uv run --with beautifulsoup4 --with lxml python scripts/scraper.py extract https://example.com

使用CSS选择器提取特定元素

uv run --with beautifulsoup4 --with lxml python scripts/scraper.py extract https://example.com/products -s .product-card

自动检测并提取表格

uv run --with beautifulsoup4 --with lxml python scripts/scraper.py tables https://example.com/pricing

提取页面中的所有链接

uv run --with beautifulsoup4 --with lxml python scripts/scraper.py links https://example.com

提取结构化数据(标题、元数据、标题、链接)

uv run --with beautifulsoup4 --with lxml python scripts/scraper.py structure https://example.com

输出为JSON格式

uv run --with beautifulsoup4 --with lxml python scripts/scraper.py extract https://example.com -s .item -f json

输出为CSV格式

uv run --with beautifulsoup4 --with lxml python scripts/scraper.py extract https://example.com -s table tr -f csv

保存到文件

uv run --with beautifulsoup4 --with lxml python scripts/scraper.py extract https://example.com -s .product -f json -o products.json

多页面抓取(跟随分页)

uv run --with beautifulsoup4 --with lxml python scripts/scraper.py crawl https://example.com/page/1 --pages 5 -s .article

命令

命令参数描述
extract<url> [-s 选择器] [-f 格式] [-o 文件]提取内容,可选通过CSS选择器过滤
tables
[-f 格式] [-o 文件] | 自动检测并提取所有HTML表格 | | links | [--external] [--internal] | 提取所有链接(href + 文本) | | structure | | 提取页面结构:标题、元数据、标题、图片、链接 | | crawl | --pages N [-s 选择器] [-f 格式] [-o 文件] | 跟随分页链接,从多个页面提取内容 |

输出格式

格式标志描述
文本-f text纯文本(默认)
JSON
-f json | 结构化JSON数组 | | CSV | -f csv | 逗号分隔值 | | Markdown | -f md | Markdown格式 |

示例

提取产品列表

bash uv run --with beautifulsoup4 --with lxml python scripts/scraper.py extract https://shop.example.com -s .product -f json

输出:
json
[
{text: Widget Pro - $29.99, tag: div, class: product},
{text: Widget Max - $49.99, tag: div, class: product}
]

提取定价表格

bash uv run --with beautifulsoup4 --with lxml python scripts/scraper.py tables https://example.com/pricing -f csv

获取所有外部链接

bash uv run --with beautifulsoup4 --with lxml python scripts/scraper.py links https://example.com --external

速率限制

  • - 默认:每秒1个请求(尊重性抓取)
  • 使用 --delay 0.5 覆盖(请求之间的秒数)
  • 默认遵守 robots.txt(使用 --ignore-robots 覆盖)

注意事项

  • - 需要 beautifulsoup4 和 lxml(由 uv run --with 自动安装)
  • 使用标准浏览器用户代理以避免被屏蔽
  • 优雅处理重定向、编码检测和错误页面
  • 不支持JavaScript渲染(适用于静态HTML页面)

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 smart-web-scraper-1776314422 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 smart-web-scraper-1776314422 技能

通过命令行安装

skillhub install smart-web-scraper-1776314422

下载

⬇ 下载 smart-web-scraper v1.0.0(免费)

文件大小: 7.88 KB | 发布时间: 2026-4-16 17:08

v1.0.0 最新 2026-4-16 17:08
Initial release of smart-web-scraper:

- Extract structured data from any web page using CSS selectors or auto-detection.
- Supports multiple output formats: text, JSON, CSV, and Markdown.
- Includes commands for extracting tables, links, structured page data, and multi-page crawling.
- Respects robots.txt and includes configurable rate limiting.
- CLI documentation and usage examples provided for quick start.
返回顶部