返回顶部
f

felo-web-extract 网页内容提取

Extract web page content from a URL using Felo Web Extract API. Use when users ask to scrape/capture/fetch webpage content, extract article text from URL, convert page to markdown/text, or when explicit commands like /felo-web-extract are used. Supports html, text, markdown output and readability mode."

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
353
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

felo-web-extract

Felo 网页提取技能

使用时机

当用户想要以下操作时触发此技能:

  • - 从网页 URL 提取或抓取内容
  • 从链接获取文章/正文
  • 将网页转换为 Markdown 或纯文本
  • 从 URL 捕获可读内容以进行摘要或处理

触发关键词(示例):

  • - 提取网页、抓取 URL、获取页面内容、网页提取、URL 转 Markdown
  • 明确指令:/felo-web-extract、使用 felo 网页提取
  • 其他语言的相同意图(例如 网页抓取、提取网页内容)也会触发此技能

不适用场景:

  • - 实时搜索或问答(请使用 felo-search)
  • 生成幻灯片(请使用 felo-slides)
  • 本地文件内容(直接读取文件)

设置

1. 获取 API 密钥

  1. 1. 访问 felo.ai
  2. 打开设置 -> API 密钥
  3. 创建并复制您的 API 密钥

2. 配置环境变量

Linux/macOS:

bash
export FELOAPIKEY=your-api-key-here

Windows PowerShell:

powershell
$env:FELOAPIKEY=your-api-key-here

执行方式

选项 A:使用捆绑脚本或打包 CLI

脚本(来自仓库):

bash
node felo-web-extract/scripts/runwebextract.mjs --url https://example.com/article [选项]

打包 CLI(执行 npm install -g felo-ai 后):支持相同选项,允许使用短格式:

bash
felo web-extract -u https://example.com [选项]

短格式:-u(URL)、-f(格式)、-t(超时,秒)、-j(JSON)

选项:

选项默认值描述
--url(必填)要提取的网页 URL
--format
markdown | 输出格式:html、text、markdown |
| --target-selector | - | CSS 选择器:仅提取此元素(例如 article.main、#content) |
| --wait-for-selector | - | 提取前等待此选择器(例如动态内容) |
| --readability | false | 启用可读性处理(仅主内容) |
| --crawl-mode | fast | fast 或 fine |
| --timeout | 60000(脚本)/ 60(CLI) | 请求超时:脚本使用毫秒,CLI 使用(例如 -t 90) |
| --json / -j | false | 以 JSON 格式打印完整 API 响应 |

如何编写指令(targetselector + outputformat)

当用户需要页面的特定部分特定输出格式时,请按如下方式表述命令:

  • - 输出格式:提取为文本 / 获取 markdown / 返回 html → 使用 --format text、--format markdown 或 --format html。
  • 定位单个元素:仅主文章 / 仅 #main 内部的内容 / 仅提取 article.main-content → 使用 --target-selector article.main 或用户提供的选择器(例如 #main、.main-content、article .post)。

用户意图与等效命令示例:

用户意图命令
将此页面提取为纯文本--url ... --format text
仅获取主要内容区域
--url ... --target-selector main 或 article |
| 提取 id=content 的 div 为 markdown | --url ... --target-selector #content --format markdown |
| 仅文章正文,HTML 格式 | --url ... --target-selector article .body --format html |

示例:

bash

基础:提取为 Markdown


node felo-web-extract/scripts/runwebextract.mjs --url https://example.com

文章风格,启用可读性

node felo-web-extract/scripts/runwebextract.mjs --url https://example.com/article --readability --format markdown

原始 HTML

node felo-web-extract/scripts/runwebextract.mjs --url https://example.com --format html --json

仅匹配 CSS 选择器的元素(例如主文章)

node felo-web-extract/scripts/runwebextract.mjs --url https://example.com --target-selector article.main --format markdown

指定输出格式 + 目标选择器

node felo-web-extract/scripts/runwebextract.mjs --url https://example.com --target-selector #content --format text

选项 B:使用 curl 调用 API

bash
curl -X POST https://openapi.felo.ai/v2/web/extract \
-H Authorization: Bearer $FELOAPIKEY \
-H Content-Type: application/json \
-d {url: https://example.com, outputformat: markdown, withreadability: true}

API 参考(摘要)

  • - 端点:POST /v2/web/extract
  • 基础 URL:https://openapi.felo.ai。如有需要,可通过 FELOAPIBASE 环境变量覆盖。
  • 认证:Authorization: Bearer YOURAPIKEY

请求体(JSON)

参数类型必填默认值描述
urlstring-要提取的网页 URL
crawl_mode
string | 否 | fast | fast 或 fine | | output_format | string | 否 | html | html、text、markdown | | with_readability | boolean | 否 | - | 使用可读性(主内容) | | withlinkssummary | boolean | 否 | - | 包含链接摘要 | | withimagessummary | boolean | 否 | - | 包含图片摘要 | | target_selector | string | 否 | - | 目标元素的 CSS 选择器 | | waitforselector | string | 否 | - | 提取前等待的选择器 | | timeout | integer | 否 | - | 超时时间(毫秒) | | with_cache | boolean | 否 | true | 使用缓存 |

响应

成功(200):

json
{
code: 0,
message: success,
data: {
content: { ... }
}
}

提取的内容位于 data.content 中;结构取决于 output_format。

错误码

HTTP代码描述
400-参数验证失败
401
INVALIDAPIKEY | API 密钥无效或已撤销 | | 500/502 | WEBEXTRACTFAILED | 提取失败(服务器或页面错误) |

输出格式

成功时(脚本未使用 --json):

  • - 仅打印提取的内容(供直接使用或管道传输)。

使用 --json 时:

  • - 打印完整 API 响应,包括 code、message、data。

向用户返回错误响应:

markdown

网页提取失败

  • - 错误:<代码或消息>
  • URL:<请求的 URL>
  • 建议:<例如检查 URL、重试或使用 --timeout>

重要说明

  • - 调用前务必检查 FELOAPIKEY;如果缺失,返回设置说明。
  • 对于长文章或加载缓慢的网站,考虑使用 --timeout 或请求体中的 timeout 参数。
  • 使用 outputformat: markdown 和 withreadability: true 获取干净的文章文本。
  • API 可能会缓存结果;仅在需要最新内容时在请求体中使用 with_cache: false(脚本默认不暴露此选项)。

参考资料

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 felo-web-extract-1776200787 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 felo-web-extract-1776200787 技能

通过命令行安装

skillhub install felo-web-extract-1776200787

下载

⬇ 下载 felo-web-extract v1.0.0(免费)

文件大小: 7.04 KB | 发布时间: 2026-4-15 12:04

v1.0.0 最新 2026-4-15 12:04
Initial release of felo-web-extract skill.

- Extracts content from web pages (URL) using the Felo Web Extract API.
- Supports extraction as HTML, plain text, or Markdown, with options for readability mode and target element via CSS selector.
- CLI script and API usage instructions included for setup and execution.
- Clearly distinguishes use cases from other skills, like felo-search and felo-slides.
- Provides troubleshooting, error codes, and output formatting guidance.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部