Xpersona
N

Novel Scraper

CLAWHUB · Unverified

智能小说抓取工具,支持自动翻页、分页补全、章节号自动解析。 使用 curl+BeautifulSoup 抓取笔趣阁等小说网站,输出格式化 TXT 文件。 默认每 10 章合并为一个文档,避免文件零散分布。 自动检测分页并补全,智能跳过非小说内容(作者感言、抽奖预告等)。 Use when: 抓取网络小说章节、批量... Skill: Novel Scraper Owner: yuzhihui886 Summary: 智能小说抓取工具,支持自动翻页、分页补全、章节号自动解析。 使用 curl+BeautifulSoup 抓取笔趣阁等小说网站,输出格式化 TXT 文件。 默认每 10 章合并为一个文档,避免文件零散分布。 自动检测分页并补全,智能跳过非小说内容(作者感言、抽奖预告等)。 Use when: 抓取网络小说章节、批量... Tags: beautifulsoup:1.2.0, bqquge:1.2.0, curl:1.2.0, latest:1.6.0, novel:1.2.0, scraper:1.2.0 Version history: v1.6.0 | 2026-04-04T09:36:58.600Z | user 代码质量修复:删除未使用导入和变量,修复 f-string 问题,通过 ruff check 所有检查 v1.5.0

62
Rank
84
Safety
1.5k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.5K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s171q47tfc9tb8mpczgympghws83jcja:novel-scraper
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-yuzhihui886-novel-scraper/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

52,122 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: novel-scraper
description: >-
  智能小说抓取工具,支持自动翻页、分页补全、章节号自动解析。
  使用 curl+BeautifulSoup 抓取笔趣阁等小说网站,输出格式化 TXT 文件。
  默认每 10 章合并为一个文档,避免文件零散分布。
  自动检测分页并补全,智能跳过非小说内容(作者感言、抽奖预告等)。
  Use when: 抓取网络小说章节、批量下载小说内容、保存小说为 TXT 格式。
---

# Novel Scraper - 小说抓取工具

**版本说明**:novel-scraper 提供两个版本,根据需求选择使用。

---

## 📦 版本对比

| 特性 | v1.4.0(生产版) | V5(智能版) |
|------|------------------|--------------|
| **章节号解析** | URL ID 推算 | 标题提取 ✅ |
| **分页检测** | ❌ 无 | ✅ 自动 ✅ |
| **分页补全** | ❌ 无 | ✅ 自动(最多 5 页)✅ |
| **非小说跳过** | ❌ 无 | ✅ 智能判断 ✅ |
| **质量验证** | ❌ 无 | ✅ 基础验证 ✅ |
| **连续性检查** | ❌ 无 | ✅ 自动检查 ✅ |
| **代码量** | 34KB | 18KB |
| **速度** | ⚡ 最快 | ⚡ 快 |
| **推荐场景** | 日常批量抓取 | 高质量/分页章节 |

---

## 🚀 快速开始

### v1.5.0(推荐)- 按章节号抓取

```bash
cd ~/.openclaw/workspace/skills/novel-scraper
python3 scripts/scraper_v5.py \
  --chapters 301-400 \
  --book "没钱修什么仙" \
  --merge-interval 10
```

**特点**:
- ✅ **按章节号精确筛选**(修复索引切片 bug)
- ✅ 自动提示缺失章节
- ✅ 分页自动补全
- ✅ 适合按章节范围抓取的场景

---

### v1.4.0(生产版)- 日常使用

```bash
cd ~/.openclaw/workspace/skills/novel-scraper
python3 scripts/scraper.py \
  --urls "https://www.bqquge.com/4/1962,https://www.bqquge.com/4/1963,..." \
  --book "没钱修什么仙" \
  --merge-interval 10
```

**特点**:
- ✅ 稳定可靠
- ✅ 速度最快
- ✅ 适合已知章节 URL 连续的场景

---

### V5(智能版)- 高质量抓取

```bash
python3 scripts/scraper_v5.py \
  --chapters 301-400 \
  --book "没钱修什么仙" \
  --merge-interval 10
```

**特点**:
- ✅ 章节号自动解析
- ✅ 分页自动补全
- ✅ 非小说内容智能跳过
- ✅ 适合分页章节较多的场景

---

## 📋 命令行参数

### v1.5.0 参数(推荐)

| 参数 | 说明 | 默认值 |
|------|------|--------|
| `--chapters` | **章节号范围**(格式:`起始 - 结束`) | - |
| `--url` | 单章 URL | - |
| `--urls` | 多章 URL(逗号分隔) | - |
| `--book` | 书名 | 自动提取 |
| `--merge-interval` | 每 N 章合并 | 10 |
| `--memory-limit` | 内存限制 MB | 2500 |
| `--auto-close` | 每 N 章释放内存 | 3 |
| `--retry` | 重试次数 | 3 |

**⚠️ v1.5.0 重要修复**:
- 修复索引切片 bug(之前 `data[300:400]` 错误对应章节号 300-419)
- 新增 `--chapters` 参数,按章节号精确筛选
- 自动提示缺失章节(网站目录中没有的章节)

### V5 参数

| 参数 | 说明 | 默认值 |
|------|------|--------|
| `--chapters` | **章节号范围**(格式:`起始 - 结束`) | - |
| `--url` | 单章 URL | - |
| `--urls` | 多章 URL(逗号分隔) | - |
| `--book` | 书名 | 自动提取 |
| `--merge-interval` | 每 N 章合并 | 10 |
| `--strict` | 严格质量验证 | 关闭 |
| `-v` | 详细日志 | 关闭 |

---

## 📁 输出位置

```
~/.openclaw/workspace/novels/
```

**文件名格式**:
- 多章合并:`书名_第 X-Y 章.txt`
- 单章:`书名_第 X 章.txt`

---

## 🧪 测试验证

| 测试场景 | 版本 | 结果 |
|----------|------|------|
| 第 1-10 章 | V5 | ✅ 119KB,完整 |
| 第 11-20 章 | V5 | ✅ 100KB,完整 |
| 第 111-210 章 | v1.4.0 | ✅ 10 个文件,~700KB |
| 分页补全 | V5 | ✅ 28 段→112 段 |
| 非小说跳过 | V5 | ✅ 自动跳过 |

---

## 🔧 故障排除

### 抓取内容为空
1. 检查 URL 格式
2. 清除缓存:`rm -rf /tmp/novel_scraper_cache/*`
3. 检查网站是否可访问

### 章节号不正确
- 使用 V5 自动从标题解析章节号

### 文件保存位置
```bash
ls -lt ~/.openclaw/workspace/novels/ | head -5
```

---

**版本**: 1.4.0  
**更新**: 2026-04-02  
**详见**: CHANGELOG.md

_meta.json

{
  "ownerId": "kn7bdv1mf6fcp7w1y4b3tzghms81taa2",
  "slug": "novel-scraper",
  "version": "1.6.0",
  "publishedAt": 1775295418600
}

CHANGELOG.md

# Changelog

All notable changes to novel-scraper will be documented in this file.

## [1.6.0] - 2026-04-04

### 🔧 Technical
- **代码质量修复**:通过 ruff check 所有检查
- 删除未使用导入(os, sys, psutil, urljoin, argparse, re, Path, datetime 重复导入)
- 修复 f-string 无占位符问题(9 处)
- 删除未使用变量(prev_count, same_count, final_content, context)

### ✅ Code Quality
- `ruff check scripts/` 所有检查通过

---

## [1.5.0] - 2026-04-03

### 🐛 Bug Fixes
- **修复索引切片 bug**:之前使用 `data[300:400]` 按索引切片,错误对应章节号 300-419(应为 301-400)
- 新增 `--chapters` 参数,支持按章节号精确筛选(格式:`--chapters 301-400`)
- 自动检测并提示缺失章节(网站目录中没有的章节)

### ✨ Features
- 新增 `scripts/extract_urls.py` 辅助脚本,用于按章节号提取 URL
- 抓取前显示统计信息:实际章节范围、章节数量、缺失章节列表

### 📝 Documentation
- 更新 SKILL.md,添加 v1.5.0 使用说明和 `--chapters` 参数文档
- 添加版本对比说明,推荐优先使用 `--chapters` 参数

### 🔧 Technical
- 添加 `json` 模块导入支持
- 新增 `load_catalog()` 函数加载目录数据
- 新增 `extract_urls_by_chapter_range()` 函数按章节号筛选

---

## [1.4.0] - 2026-04-02

### ✨ Features
- 内存监控融合方案(趋势预测 + 分级释放)
- 修复趋势预测除数错误(`history_window - 1`)
- 日志级别优化(debug → info)

### 🐛 Bug Fixes
- 分页检测与自动补全(最多 5 页)
- 连续性验证(缺章检测与报告)

---

## [1.3.0] - 2026-04-02

### ✨ Features
- V4 完整版:章节号自动解析、内容质量评分、分页补全

---

## [1.2.0] - 2026-04-02

### ✨ Features
- 合并功能:默认每 10 章合并为一个文档

---

## [1.1.0] - 2026-03-29

### ✨ Features
- SPA 网站自动检测
- 批量抓取功能(`--urls` 参数)

---

## [1.0.0] - 2026-03-29

### ✨ Features
- 初始版本:笔趣阁抓取、自动翻页、内存监控

RELEASE_NOTES.md

# novel-scraper v1.5.0 发布说明

## 🐛 关键 Bug 修复

**问题**:用户请求抓取第 301-400 章,实际抓取了第 300-419 章(120 章)

**根因**:使用索引切片 `data[300:400]` 而非按章节号筛选
- 索引 300-399 → 章节号 300-419(错误)
- 应为章节号 301-400(正确)

**修复**:
- 新增 `--chapters` 参数,按章节号精确筛选
- 自动提示缺失章节(网站目录中没有的章节)

## ✨ 新功能

### 按章节号范围抓取

```bash
# ✅ 推荐用法(v1.5.0)
python3 scripts/scraper_v5.py --chapters 301-400 --book "没钱修什么仙"

# 输出:
# 📋 章节号范围:301-400
# 📋 实际抓取:301-399 (83 章)
# ⚠️ 缺失 17 章(网站目录中没有)
```

### 辅助脚本

```bash
# 提取指定章节范围的 URL
python3 scripts/extract_urls.py 301 400
```

## 📊 对比

| 版本 | 参数 | 结果 | 问题 |
|------|------|------|------|
| v1.4.0 | `data[300:400]` | 章节号 300-419 | ❌ 索引切片错误 |
| v1.5.0 | `--chapters 301-400` | 章节号 301-399 | ✅ 按章节号筛选 |

## ⚠️ 注意事项

1. **缺失章节**:网站目录本身可能缺失某些章节(如第 345、367-370、381-384、389-396、400 章)
2. **向后兼容**:`--url` 和 `--urls` 参数继续有效
3. **推荐用法**:优先使用 `--chapters` 参数

## 📦 安装

```bash
# 从 ClawHub 安装
clawhub install novel-scraper

# 或本地安装
cd ~/.openclaw/workspace/skills/novel-scraper
pip install -e .
```

## 📖 完整文档

详见 `SKILL.md`

skill-card.md

## Description:

Novel Scraper helps agents fetch web novel chapters from configured novel sites, detect pagination and chapter numbers, skip non-novel content, and save formatted TXT files.

This skill is ready for commercial/non-commercial use.

## Publisher:

[yuzhihui886](https://clawhub.ai/user/yuzhihui886)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and agent users use this skill to download and organize web novel chapters as local TXT files, including chapter-range scraping, pagination completion, and merged output files.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The skill makes outbound web requests and follows redirects when fetching novel pages.

Mitigation: Use it only with public novel-site URLs you trust and review target URLs before execution.

Risk: Fetched text, logs, cache, catalog, and progress data are stored locally.

Mitigation: Review generated files before sharing them and clear local cache or logs when they are no longer needed.

Risk: Dependency ranges are not fully pinned, which can affect reproducibility.

Mitigation: Pin dependencies in controlled environments that require repeatable installs.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/yuzhihui886/skills/novel-scraper)
- [Skill documentation](artifact/SKILL.md)
- [Changelog](artifact/CHANGELOG.md)
- [Release notes](artifact/RELEASE_NOTES.md)

## Skill Output:

**Output Type(s):** [text, shell commands, configuration, guidance]

**Output Format:** [Markdown guidance with shell command examples; generated scraper outputs are UTF-8 TXT files.]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Writes novel text, logs, cache, catalog, and progress files locally under the OpenClaw workspace and /tmp cache paths.]

## Skill Version(s):

1.6.0 (source: server release evidence, _meta.json, CHANGELOG.md; changelog released 2026-04-04)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Novel Scraper and adjacent AI workflows.