SuperAPI AI 工具集

distill-page

通用与其它

查看项目

更新于 10-16 03:16

技能介绍

用途:从网页中提取高质量、无噪声的 Markdown 内容。与依赖标记语法启发式的通用 HTML 转 Markdown 工具(如 Turndown)不同,它使用 Chromium 的视觉机器学习布局分析,自动识别语义角色(如 ARTICLE 和 MAIN),并排除侧边栏、导航元素、页脚和弹窗。

主要能力:输出蒸馏后的 Markdown,或输出原始解码的 protobuf JSON 结构。

使用方式: node agents/skills/distill-page/scripts/distill-page.ts [--markdown] <URL>

选项: --markdown:输出蒸馏后的 Markdown(推荐);不加此选项则输出原始解码的 protobuf JSON。 --base64-stdin:不通过 Playwright 抓取,而是解码通过 stdin 传入的 base64 编码 protobuf 载荷。

示例: node agents/skills/distill-page/scripts/distill-page.ts --markdown https://example.com node agents/skills/distill-page/scripts/distill-page.ts https://example.com

要求:启动有头浏览器(headless: false),并需要 Chromium 功能标志:--enable-dom-distiller、--enable-features=OptimizationHints,PageContentAnnotation,OptimizationGuideModelDownloading。需安装 Playwright 和 ProtobufJS。

限制:依赖 Chromium 实验性设备端 ML 模型标注,需有头模式运行;具体平台支持、收费与效果等资料暂未提供。