Search & Analysis v1.1.0

scrape-web

使用 Python + Scrapling 获取网页内容,支持简单选择器

jnmhub 更新于 2026-03-17 1 浏览
下载 SKILL

技能说明

使用 Python + Scrapling 获取网页内容,支持简单选择器

使用场景

使用 Python + Scrapling 获取网页内容,支持简单选择器

查看英文原始说明

使用 Python + Scrapling 获取网页内容,支持简单选择器

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

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

技能文件内容

4 个文件 · 22 kB
SKILL.md text/markdown
---
name: scrape-web
description: "使用 Python + Scrapling 获取网页内容,支持简单选择器"
version: "1.1.0"
tags:
  - python
  - scrape
  - web
requires:
  tools: ["exec"]
  env: ["python"]
---

# Scrape Web Skill

使用 Scrapling 获取网页内容,返回纯文本或选择器结果。

## 安装依赖

```bash
pip install "scrapling[all]"
scrapling install
pip install httpx
```

## 用法

### 1) 直接抓取纯文本

```bash
python scripts/scrape_web.py --url "https://example.com"
```

### 2) 使用 CSS 选择器

```bash
python scripts/scrape_web.py --url "https://example.com" --selector "title::text"
```

### 3) 保存到文件

```bash
python scripts/scrape_web.py --url "https://example.com" --out "output.txt"
```

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