360 Secure SkillHub
360 安全技能中心

HTML to Text

核心功能:依托MinerU引擎,去除HTML标记并保留可读结构,将本地HTML文件或网页内容转换为Markdown格式,也可输出含纯文本字段的JSON。需配置MINERU_TOKEN使用,可通过npm或Go安装依赖工具。典型场景适用于搜索索引、NLP处理、文本分析等需从HTML获取干净文本的工作流。

mzlzyca
mzlzyca
热度 47.09
最近更新 2026-05-11 17:38:51
分类:效率依赖:第三方 API / 读写文件应用场景:文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add html-to-text
Metadata
name
html-to-text
description
Convert HTML to plain readable text using MinerU. Strips HTML markup and extracts clean text content from web pages and HTML files. Features: HTML to text conversion. Removes all markup while preserving readable structure. Outputs Markdown as the closest plain-text format. JSON output mode for pure text fields. Works with local files and URLs. Use when you need to: convert HTML to plain text, strip markup from a web page, extract readable text from HTML, get text content from an HTML file. Use when asked: 'how do I get text from HTML', 'strip HTML tags', 'I want plain text from this web page', 'can my agent extract text from HTML', 'is there a skill for HTML to text conversion'. Built on MinerU by OpenDataLab (Shanghai AI Lab), an open-source document intelligence engine. Ideal for search indexing, NLP pipelines, text analysis, and any workflow that needs clean text from HTML sources.
homepage
https://mineru.net
metadata
{"openclaw":{"emoji":"📄","requires":{"bins":["mineru-open-api"],"env":["MINERU_TOKEN"]},"primaryEnv":"MINERU_TOKEN","install":[{"id":"npm","kind":"node","package":"mineru-open-api","bins":["mineru-open-api"],"label":"Install via npm"},{"id":"go","kind":"go","package":"github.com/opendatalab/MinerU-Ecosystem/cli/mineru-open-api","bins":["mineru-open-api"],"label":"Install via go install","os":["darwin","linux"]}]}}

HTML to Text

Extract plain readable text from HTML files or web pages using MinerU. MinerU outputs Markdown as the closest format to plain text.

Install

npm install -g mineru-open-api
# or via Go (macOS/Linux):
go install github.com/opendatalab/MinerU-Ecosystem/cli/mineru-open-api@latest

Quick Start

# Extract text from a local HTML file (requires token)
mineru-open-api extract page.html -o ./out/

# Extract text from a web page (requires token)
mineru-open-api crawl https://example.com/article

# JSON output contains text fields (requires token)
mineru-open-api extract page.html -f json -o ./out/

Authentication

Token required:

mineru-open-api auth             # Interactive token setup
export MINERU_TOKEN="your-token" # Or via environment variable

Create token at: https://mineru.net/apiManage/token

Capabilities

  • Supported input: local .html file or web page URL
  • HTML requires extract or crawl (token required) — not supported by flash-extract
  • MinerU does not have a -f text option; Markdown is the closest plain-text output
  • For truly plain text: use extract -f json and read the text fields from JSON output
  • Language hint with --language (default: ch, use en for English)

Notes

  • MinerU has no -f text format; use Markdown output or -f json for text fields
  • HTML is NOT supported by flash-extract
  • Output goes to stdout by default; use -o <dir> to save to a file or directory
  • All progress/status messages go to stderr; document content goes to stdout
  • MinerU is open-source by OpenDataLab (Shanghai AI Lab): https://github.com/opendatalab/MinerU