网页抓取服务

智能网页抓取服务,支持静态页面、JavaScript渲染的SPA(通过Playwright)和自然语言数据提取。

  • by Aegis-AI-Cooperative
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 sangokp/mcp-scraper

使用说明

@神盾ai/mcp刮刀

用于智能网络抓取的MCP服务器。支持静态页面、JavaScript渲染的SPA(通过Playwright)和自然语言数据提取。

安装

# Add to Claude Desktop config (~/.claude/claude_desktop_config.json):
{
  "mcpServers": {
    "scraper": {
      "command": "bunx",
      "args": ["@aegis-ai/mcp-scraper"]
    }
  }
}

# Or run directly:
bunx @aegis-ai/mcp-scraper

工具

刮擦

获取网页并返回干净的文本内容。

{
  "url": "https://news.ycombinator.com",
  "js": false,
  "selector": ".titleline",
  "headers": { "Cookie": "session=abc" }
}

提取

使用自然语言抓取页面并提取结构化数据。

{
  "url": "https://example.com/products",
  "prompt": "Get all product names, prices, and ratings",
  "js": true
}

batch_scrape

使用速率限制(请求之间1秒)抓取多个URL。

{
  "urls": ["https://example.com/page1", "https://example.com/page2"],
  "js": false
}

特性

  • 静态页面抓取(快速,无需浏览器)
  • 通过Playwright进行JavaScript渲染(适用于SPA)
  • CSS选择器定位
  • 自定义标头支持
  • 自动HTML剥离
  • 内容截断以避免上下文溢出
  • 速率受限的批量刮擦

许可证

麻省理工学院-AEGIS人工智能合作