SuperAPI AI 工具集

just-scrape

编程与开发

查看项目

更新于 10-16 06:44

技能介绍

用途:just-scrape 是 ScrapeGraph AI 的 AI 网页抓取 CLI,用于抓取网站、提取结构化数据、搜索、爬取与浏览器自动化。需先在 dashboard.scrapegraphai.com 获取 API Key。

安装与配置:建议始终使用 @latest 版本,例如 npm install -g just-scrape@latest(也支持 pnpm、yarn、bun 全局安装,或用 npx/bunx 免安装运行)。设置 export SGAI_API_KEY="sgai-..."。密钥解析顺序为环境变量 SGAI_API_KEY → .env 文件 → ~/.scrapegraphai/config.json → 交互式提示(保存到配置)。

主要命令:smart-scraper 从已知 URL 提取结构化数据;search-scraper 搜索网络并提取结果;markdownify 将页面转为干净 Markdown;crawl 爬取多页;scrape 获取原始 HTML;agentic-scraper 自动化浏览器操作(登录、点击、填表);generate-schema 由描述生成 JSON Schema;sitemap 获取站点全部 URL;credits 查询余额;history 浏览历史请求;validate 校验 API Key。所有命令支持 --json 输出机器可读结果。抓取类命令共用 --stealth(绕过反爬,+4 积分)、--headers、--schema 等参数。

使用方式:如 just-scrape smart-scraper <url> -p <prompt>,可加 --schema、--scrolls、--pages、--stealth、--cookies、--headers、--plain-text;search-scraper 支持 --num-results、--no-extraction;crawl 支持 --max-pages、--depth、--rules、--no-sitemap;agentic-scraper 用 -s 传入逗号分隔步骤,可配 --ai-extraction、--use-session。

限制与费用:--stealth 每请求 +4 积分,--branding(仅 scrape)+2,search-scraper 提取 10 积分/请求、--no-extraction 2 积分/请求,crawl --no-extraction 2 积分/页。环境变量包括 SGAI_API_KEY、JUST_SCRAPE_TIMEOUT_S(默认 120 秒)、JUST_SCRAPE_DEBUG。具体价格与平台支持等资料未提供。