Documentation v1.0.0

tra-extract-text

Extract text content from web pages using trafilatura CLI. Use when user wants to extract readable text, markdown, or...

goog 更新于 2026-03-15 1 浏览
下载 SKILL

技能说明

Extract text content from web pages using trafilatura CLI. Use when user wants to extract readable text, markdown, or raw HTML from a URL. Triggers on requests like: "extract text from URL", "scrape web page content", "get article text", "convert web page to markdown", "trafilatura".

使用场景

Extract text from web pages using the trafilatura command-line tool.

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

帮我下载并安装这个SKILL:https://skillhub.cstcloud.cn/download/tra-extract-text
  1. 点击上方「下载 SKILL」按钮,获取技能压缩包。
  2. 将压缩包解压到你的 Agent 技能目录。
  3. 重启客户端后即可在技能列表中选择该技能。

技能文件内容

4 个文件 · 18 kB
SKILL.md text/markdown
---
name: tra-extract-text
description: Extract text content from web pages using trafilatura CLI. Use when user wants to extract readable text, markdown, or raw HTML from a URL. Triggers on requests like: "extract text from URL", "scrape web page content", "get article text", "convert web page to markdown", "trafilatura".
---

# tra-extract-text

Extract text from web pages using the `trafilatura` command-line tool.

## Installation

```bash
pip install trafilatura
```

## Usage

### Basic text extraction (Markdown)

```bash
trafilatura -u URL --markdown
```

### Extract raw text (no formatting)

```bash
trafilatura -u URL --text
```

### Output to file

```bash
trafilatura -u URL --markdown > output.md
trafilatura -u URL --text > output.txt
```

### CLI Options

| Option | Description |
|--------|-------------|
| `-u, --url` | Target URL (required) |
| `--markdown` | Output as Markdown (default) |
| `--text` | Output as plain text |
| `--html` | Output as HTML |
| `--json` | Output as JSON |
| `--xml` | Output as XML |
| `-o, --output` | Write to file instead of stdout |
| `--with-metadata` | Include metadata (title, author, date) |
| `--license` | Show license info |

## Examples

Extract a Medium article to markdown:
```bash
trafilatura -u "https://medium.com/example/article" --markdown
```

Extract and save:
```bash
trafilatura -u "https://news.example.com/article" --markdown -o article.md
```

Extract with metadata:
```bash
trafilatura -u "https://example.com/post" --markdown --with-metadata
```

文件内容直接读取自技能仓库,仅供安装前审阅;以实际下载的压缩包为准。