用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Demerzels-lab/elsamultiskillagent --skill xiaohongshu-scraper命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
The philosophical layer for AI agents.
Agents can sign plugins, rotate credentials without losing identity, and publicly attest to behavior.
A relaxing resource-gathering RPG where AI agents collect resources, trade with NPCs, and manage and build their world at their own pace.
基于 SOC 职业分类
正在显示 SKILL.md
| name | xiaohongshu-scraper |
| version | 1.0.0 |
| description | 小红书内容爬取和整理。用于搜索小红书笔记、提取详细内容(正文、评论、图片)、生成整理好的 Markdown 文档。当用户要求搜索小红书、查找小红书攻略、整理小红书内容时使用。 |
基于 XHS-Downloader 的小红书笔记抓取工具。
cd /Users/lixiaoji/clawd/skills/xiaohongshu-scraper/scripts
./xhs-api-service.sh start
# 抓取笔记,下载图片,OCR识别,保存到指定文件夹
python xhs_scraper.py "笔记URL" --output /tmp/xhs_note
# 批量抓取多个链接
python xhs_scraper.py "URL1" "URL2" "URL3" --output /tmp/xhs_notes
# 不进行 OCR(更快)
python xhs_scraper.py "笔记URL" --output /tmp/xhs_note --no-ocr
# 仅获取信息不下载
python xhs_scraper.py "笔记URL" --info-only
# 输出 JSON 格式
python xhs_scraper.py "笔记URL" --json
https://www.xiaohongshu.com/explore/作品ID?xsec_token=XXXhttps://www.xiaohongshu.com/discovery/item/作品ID?xsec_token=XXXhttps://www.xiaohongshu.com/user/profile/作者ID/作品ID?xsec_token=XXXhttps://xhslink.com/分享码(短链接)# 启动服务
./xhs-api-service.sh start
# 停止服务
./xhs-api-service.sh stop
# 重启服务
./xhs-api-service.sh restart
# 查看状态
./xhs-api-service.sh status
服务运行后,可以直接调用 API:
# 获取笔记信息
curl -X POST http://127.0.0.1:5556/xhs/detail \
-H "Content-Type: application/json" \
-d '{"url": "笔记链接", "download": true}'
API 文档:http://127.0.0.1:5556/docs
output_dir/
├── 作品ID/
│ ├── note.json # 结构化数据(完整信息)
│ ├── note.md # Markdown 文档
│ ├── images/ # 下载的图片
│ │ ├── 01.jpeg
│ │ ├── 02.jpeg
│ │ └── ...
│ └── ocr/ # OCR 识别结果
│ ├── 01.md # 每张图片对应的 OCR 文本
│ ├── 02.md
│ └── ...
{
"note_id": "笔记ID",
"fetch_time": "抓取时间",
"title": "标题",
"desc": "描述/正文",
"type": "作品类型(图文/视频)",
"author": {
"nickname": "作者昵称",
"user_id": "作者ID",
"profile_url": "作者主页"
},
"interact": {
"liked_count": 123,
"collected_count": 456,
"comment_count": 78,
"share_count": 9
},
"tags":
import subprocess
import json
from pathlib import Path
def scrape_xhs_note(url: str, output_dir: str) -> dict:
"""抓取小红书笔记"""
script = "/Users/lixiaoji/clawd/skills/xiaohongshu-scraper/scripts/xhs_scraper.py"
result = subprocess.run(
["python", script, url, "--output", output_dir, "--json"],
capture_output=True,
text=True
)
if result.returncode == 0:
return json.loads(result.stdout)
else:
raise Exception(result.stderr)
# 使用示例
data = scrape_xhs_note("https://www.xiaohongshu.com/explore/xxx", "/tmp/xhs")
print(data["title"])
| 脚本 | 用途 |
|---|---|
xhs_scraper.py | 完整抓取工具(推荐):下载+OCR+保存 |
xhs_api_client.py | 简单客户端:仅获取信息 |
xhs-api-service.sh | API 服务管理脚本 |
xhs_download.py | 直接调用源码下载(无需 API) |
/Users/lixiaoji/Downloads/XHS-Downloader-master-2)| 项目 | 路径 |
|---|---|
| XHS-Downloader 源码 | /Users/lixiaoji/Downloads/XHS-Downloader-master-2 |
| 默认下载目录 | /Users/lixiaoji/Downloads/XHS-Downloader_V2/_internal/Volume/Download |
| 默认输出目录 | /Users/lixiaoji/clawd/data/xhs |
| API 日志 | /tmp/xhs-downloader-api.log |
--output 参数将文件整理保存到指定目录lsof -i :5556cat /tmp/xhs-downloader-api.logcd /Users/lixiaoji/Downloads/XHS-Downloader-master-2
source venv/bin/activate
python main.py api
发布时间_作者昵称_标题_序号.扩展名