360 Secure SkillHub
360 安全技能中心

Web Scraper

该 Skill 通过命令行脚本从网页抓取数据,支持静态 HTML 解析与 JavaScript 渲染、CSS/XPath 选择器、多字段提取、多页爬取和 AI 提取,结果以 JSON 输出。但包内缺少 scripts/scrape.py,核心功能无法实际运行。

jpengcheng523-netizen
jpengcheng523-netizen
热度 53.32
最近更新 2026-05-11 17:35:58
分类:自动化依赖:代码执行 / 联网浏览搜索 / 读写文件 / 内部调用大模型应用场景:自动化脚本 / 数据处理 / 研究

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add jpeng-web-scraper
Metadata
name
jpeng-web-scraper
description
Web scraping skill with JavaScript rendering support. Extract data from websites using CSS selectors, XPath, or AI-powered extraction.
version
1.0.0
author
jpeng
tags
["web","scraping","extraction","crawler","playwright"]

Web Scraper

Extract data from websites with support for dynamic content.

When to Use

  • User wants to scrape data from a website
  • Extract structured data from HTML
  • Handle JavaScript-rendered pages
  • Crawl multiple pages

Features

  • Static pages: Fast HTML parsing
  • Dynamic pages: Playwright/Puppeteer rendering
  • Selectors: CSS, XPath, regex
  • AI extraction: Auto-detect data patterns

Usage

Simple scrape

python3 scripts/scrape.py \
  --url "https://example.com/products" \
  --selector ".product-name" \
  --output ./products.json

With JavaScript rendering

python3 scripts/scrape.py \
  --url "https://spa-example.com/data" \
  --render \
  --wait 2000 \
  --selector ".data-item"

Extract multiple fields

python3 scripts/scrape.py \
  --url "https://example.com/listings" \
  --fields '{
    "title": "h1.title",
    "price": ".price",
    "description": ".desc"
  }'

Crawl multiple pages

python3 scripts/scrape.py \
  --url "https://example.com/page/1" \
  --crawl 'a[href*="/page/"]' \
  --max-pages 10 \
  --selector ".item"

AI-powered extraction

python3 scripts/scrape.py \
  --url "https://example.com/article" \
  --ai-extract "Extract the title, author, and publication date"

Output

{
  "success": true,
  "url": "https://example.com/products",
  "items": [
    {"name": "Product 1", "price": "$99"},
    {"name": "Product 2", "price": "$149"}
  ],
  "scraped_at": "2024-01-15T10:30:00Z"
}

Rate Limiting

  • Default delay: 1 second between requests
  • Respects robots.txt
  • Customizable user agent