Search

PythonReactSEOPDF
OpenClaw

xiaohongshu-skill

当用户想要与小红书(xiaohongshu/rednote)交互时使用此 Skill。包括搜索笔记、获取帖子详情、查看用户主页、二维码扫码登录、提取平台内容等。当用户提到 xiaohongshu、小红书、rednote,或需要浏览/抓取中国社交媒体内容时激活此 Skill。

deliciousbuding0 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install deliciousbuding/xiaohongshu-skill

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

小红书 Skill

基于 Python Playwright 的小红书(rednote)交互工具,通过浏览器自动化从 window.__INITIAL_STATE__(Vue SSR 状态)中提取结构化数据。

前置条件

在 {baseDir} 目录下安装依赖:

cd {baseDir}
pip install -r requirements.txt
playwright install chromium

Linux/WSL 环境还需运行:

playwright install-deps chromium

快速开始

所有命令从 {baseDir} 目录运行。

1. 登录(首次必须)
cd {baseDir}

# 打开浏览器窗口,显示二维码供微信/小红书扫描
python -m scripts qrcode --headless=false

# 检查登录是否仍然有效
python -m scripts check-login

在无头环境下,二维码图片保存到 {baseDir}/data/qrcode.png,可通过其他渠道发送扫码。

2. 搜索
cd {baseDir}

# 基础搜索
python -m scripts search "关键词"

# 带筛选条件
python -m scripts search "美食" --sort-by=最新 --note-type=图文 --limit=10

筛选选项:

  • --sort-by:综合、最新、最多点赞、最多评论、最多收藏
  • --note-type:不限、视频、图文
  • --publish-time:不限、一天内、一周内、半年内
  • --search-scope:不限、已看过、未看过、已关注
  • --location:不限、同城、附近
3. 帖子详情
cd {baseDir}

# 使用搜索结果中的 id 和 xsec_token
python -m scripts feed <feed_id> <xsec_token>

# 加载评论
python -m scripts feed <feed_id> <xsec_token> --load-comments --max-comments=20
4. 用户主页
cd {baseDir}
python -m scripts user <user_id> [xsec_token]

数据提取路径

数据类型 JavaScript 路径
搜索结果 window.__INITIAL_STATE__.search.feeds
帖子详情 window.__INITIAL_STATE__.note.noteDetailMap
用户信息 window.__INITIAL_STATE__.user.userPageData
用户笔记 window.__INITIAL_STATE__.user.notes

Vue Ref 处理: 始终通过 .value 或 ._value 解包:

const data = obj.value !== undefined ? obj.value : obj._value;

反爬保护

本 Skill 内置了针对小红书反机器人策略的保护措施:

  • 频率控制:两次导航间自动延迟 3-6 秒,每 5 次连续请求后冷却 10 秒
  • 验证码检测:自...

Source information

Source
github
Repository
openclaw/skills
Path
skills/deliciousbuding/xiaohongshu-skill
Version
—
Commit
3ebdc17173814f44440adcaae8d88a42b03dcc4a
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

SKILL.md
# 小红书 Skill

基于 Python Playwright 的小红书(rednote)交互工具,通过浏览器自动化从 `window.__INITIAL_STATE__`(Vue SSR 状态)中提取结构化数据。

## 前置条件

在 `{baseDir}` 目录下安装依赖:

```bash
cd {baseDir}
pip install -r requirements.txt
playwright install chromium
```

Linux/WSL 环境还需运行:
```bash
playwright install-deps chromium
```

## 快速开始

所有命令从 `{baseDir}` 目录运行。

### 1. 登录(首次必须)

```bash
cd {baseDir}

# 打开浏览器窗口,显示二维码供微信/小红书扫描
python -m scripts qrcode --headless=false

# 检查登录是否仍然有效
python -m scripts check-login
```

在无头环境下,二维码图片保存到 `{baseDir}/data/qrcode.png`,可通过其他渠道发送扫码。

### 2. 搜索

```bash
cd {baseDir}

# 基础搜索
python -m scripts search "关键词"

# 带筛选条件
python -m scripts search "美食" --sort-by=最新 --note-type=图文 --limit=10
```

**筛选选项:**
- `--sort-by`:综合、最新、最多点赞、最多评论、最多收藏
- `--note-type`:不限、视频、图文
- `--publish-time`:不限、一天内、一周内、半年内
- `--search-scope`:不限、已看过、未看过、已关注
- `--location`:不限、同城、附近

### 3. 帖子详情

```bash
cd {baseDir}

# 使用搜索结果中的 id 和 xsec_token
python -m scripts feed <feed_id> <xsec_token>

# 加载评论
python -m scripts feed <feed_id> <xsec_token> --load-comments --max-comments=20
```

### 4. 用户主页

```bash
cd {baseDir}
python -m scripts user <user_id> [xsec_token]
```

## 数据提取路径

| 数据类型 | JavaScript 路径 |
|----------|----------------|
| 搜索结果 | `window.__INITIAL_STATE__.search.feeds` |
| 帖子详情 | `window.__INITIAL_STATE__.note.noteDetailMap` |
| 用户信息 | `window.__INITIAL_STATE__.user.userPageData` |
| 用户笔记 | `window.__INITIAL_STATE__.user.notes` |

**Vue Ref 处理:** 始终通过 `.value` 或 `._value` 解包:
```javascript
const data = obj.value !== undefined ? obj.value : obj._value;
```

## 反爬保护

本 Skill 内置了针对小红书反机器人策略的保护措施:

- **频率控制**:两次导航间自动延迟 3-6 秒,每 5 次连续请求后冷却 10 秒
- **验证码检测**:自...

Related skills

OpenClaw

openbotx

openbotx

An open-source platform for orchestrating AI agents — secure, simple, and built for everyone. Multi-agent, real-time task board, web control panel, skills system, browser automation, multi-provider, scheduler,...

OpenClaw

zsxq-digest

sealiu1997

OpenClaw skill for 知识星球 / ZSXQ digests with token-first auth and browser recovery.

OpenClaw

browser-use-skill

abczsl520

🌐 OpenClaw skill for Browser-Use — AI-powered browser automation for complex multi-step workflows (login, form filling, scraping, posting)