SuperAPI AI 工具集

scraping-html-to-markdown

数据与分析

查看项目

更新于 10-16 06:16

技能介绍

用途:crawlberg scrape <url> 面向单页抓取,返回 Markdown 加结构化数据(元数据、links、images、JSON-LD、HTTP 响应信息),可用于生成可读文件或作为下游 LLM 上下文。

主要能力:--format 支持 json(默认)或 markdown;可设置 --timeout、--proxy、--user-agent、--respect-robots-txt、--browser-mode(auto/always/never)、--browser-endpoint、--config。JSON 输出为顶层 PageResult,含 url、final_url、status_code、markdown(content、fit_content、warnings)、metadata(OG、Twitter Card、Dublin Core、headings、feeds、favicons、hreflang 等)、links、images、tables 与 response;脚本中读取 result.markdown.content。

用法示例:crawlberg scrape https://example.com/article --format markdown;如需元数据用 --format json;可配合 jq 提取 OG 字段。

限制与注意:静态抓取遇 JS 外壳时内容可能为空或仅有导航页脚,警告含 JS-render-required,可改用 --browser-mode always;自动模式可识别 8 种 WAF 并重试,若强制 never 则可能被 403/406/503 拦截;设置 --respect-robots-txt 后禁止路径会直接报错;无编码覆盖选项,错误声明的字符集需自行重新抓取并转码。整站抓取用 crawl,交互操作用 interact,仅需 URL 用 map。