← Back to Skills Marketplace
besty0121

Xiaohongshu Browser

by besty0121 · GitHub ↗ · v1.2.1 · MIT-0
cross-platform ✓ Security Clean
199
Downloads
1
Stars
1
Active Installs
4
Versions
Install in OpenClaw
/install xiaohongshu-browser
Description
Browse Xiaohongshu (小红书) and take screenshots of posts. Supports keyword search, post modal screenshots, and returns post links. Requires prior manual login.
README (SKILL.md)

Xiaohongshu Browser / 小红书浏览器

用 Playwright 自动化浏览小红书,搜索关键词并截图帖子弹窗预览。

Automate Xiaohongshu browsing — search keywords and screenshot post modal previews.

前置要求 / Prerequisites

Python 3.x + Playwright

pip install playwright
playwright install chromium

使用步骤

第一步:首次登录(只需要做一次)

  1. 运行登录脚本,会弹出浏览器窗口:
python \x3Cskill_dir>/scripts/xhs_open.py
  1. 在弹出的浏览器里手动登录小红书(扫码或账号密码都行)

  2. 登录成功后,创建一个控制文件来保存登录状态:

# Windows (PowerShell):
Set-Content "$env:USERPROFILE\.openclaw\.close_browser" "CLOSE"

# Windows (CMD):
echo CLOSE > %USERPROFILE%\.openclaw\.close_browser

# Linux / macOS:
echo CLOSE > ~/.openclaw/.close_browser
  1. 看到终端输出 AUTH_SAVED 就说明登录状态保存好了

💡 登录状态保存在 ~/.openclaw/xhs_data,以后搜索时会自动使用,不需要重复登录。

第二步:搜索并截图

python \x3Cskill_dir>/scripts/xhs_search.py "关键词" 数量

参数说明:

  • 第一个参数:搜索关键词(默认:御姐
  • 第二个参数:截图几个帖子(默认:5

示例:

# 搜索"美食",截图前3个帖子
python \x3Cskill_dir>/scripts/xhs_search.py "美食" 3

# 搜索"穿搭",截图前10个
python \x3Cskill_dir>/scripts/xhs_search.py "穿搭" 10

# 不传参数,用默认值
python \x3Cskill_dir>/scripts/xhs_search.py

输出结果

截图保存在 \x3Cskill_dir>/output/ 目录,文件名格式:post_序号_时间戳.png

每张截图包含帖子弹窗预览(图文详情)。

常见问题

需要重新登录?

小红书的登录会过期,如果搜索时遇到登录弹窗,需要重新登录:

# 1. 删除旧的登录数据
# Windows:
Remove-Item -Recurse -Force "$env:USERPROFILE\.openclaw\xhs_data"
# Linux / macOS:
rm -rf ~/.openclaw/xhs_data

# 2. 重新运行登录脚本
python \x3Cskill_dir>/scripts/xhs_open.py

搜索没结果?

  • 小红书可能会限制频繁访问,等几分钟再试
  • 关键词不要太长,2-6个字最佳
  • 不要带 # 号,直接搜关键词

目录结构

xiaohongshu-browser/
├── SKILL.md              # 本说明文件
├── scripts/
│   ├── xhs_open.py       # 登录脚本(首次使用)
│   └── xhs_search.py     # 搜索+截图脚本
└── output/               # 截图输出目录

注意事项

  • 使用无头浏览器(headless),不会弹出窗口
  • 操作间有随机延迟,降低被检测风险
  • 频繁使用可能触发小红书的反爬机制
  • 帖子链接需要 xsec_token 才能直接访问(搜索结果中已包含)
Usage Guidance
This skill appears to do what it says: it automates a browser to let you manually log in once and then perform headless searches and screenshots. Before installing/running: 1) manually install Playwright and review the installation commands in SKILL.md; 2) understand that the skill saves login/session data under ~/.openclaw (xhs_data and xhs_auth.json) — anyone with access to those files could reuse the session, so don't run on an untrusted or shared machine; 3) note the documentation mismatch: xhs_open.py opens a visible browser for manual login (not headless), while xhs_search.py runs headless; follow the login step as documented; 4) the tool may trigger site anti-bot protections (the script includes retry waits), and scraping may violate Xiaohongshu terms — proceed accordingly. If you need the skill to avoid persistent login state, do not permit it to write ~/.openclaw or periodically delete the saved auth files.
Capability Analysis
Type: OpenClaw Skill Name: xiaohongshu-browser Version: 1.2.1 The xiaohongshu-browser skill automates searching and screenshotting posts on Xiaohongshu using Playwright. It handles session persistence by storing browser data locally in `~/.openclaw/xhs_data` and includes logic to manage IP blocks and UI popups. The code and instructions (SKILL.md, xhs_open.py, xhs_search.py) are consistent with the stated purpose and show no signs of malicious intent, unauthorized data exfiltration, or prompt injection.
Capability Assessment
Purpose & Capability
Name/description (browse Xiaohongshu, search, screenshot) match the provided Python scripts which use Playwright to open the site, persist login state under ~/.openclaw/xhs_data, perform searches, click posts, and take screenshots. Required binary is only python, which is appropriate.
Instruction Scope
SKILL.md instructions align with the scripts' behavior (manual login via xhs_open.py, then automated search via xhs_search.py). Minor inconsistencies: SKILL.md's '注意事项' states '使用无头浏览器(headless),不会弹出窗口', but xhs_open.py launches a visible browser (headless=False) for manual login while xhs_search.py runs headless. SKILL.md mentions xsec_token for direct post access but the scripts do not extract or transmit tokens. Overall the instructions do not ask the agent to read unrelated system files or exfiltrate data to external endpoints.
Install Mechanism
No automated install spec included; SKILL.md instructs the user to pip install playwright and run 'playwright install chromium'. This is a standard, user-run setup and no arbitrary remote archives or installers are pulled by the skill itself.
Credentials
The skill requests no environment variables or external credentials. It writes and reads state under the user's HOME (~/.openclaw) including storage_state (xhs_auth.json) and a user-data directory (xhs_data) which will contain cookies/session data — this is expected for persistent logins but is sensitive (can be used to access the account). The amount of access is proportionate to the task but users should be aware of privacy risks of saved web auth state.
Persistence & Privilege
The skill does not request 'always: true' and is user-invocable only. It stores its own files under ~/.openclaw and does not modify other skills or system-wide agent settings. Autonomous invocation remains enabled by default, but that is platform normal behavior and not abused here.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install xiaohongshu-browser
  3. After installation, invoke the skill by name or use /xiaohongshu-browser
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.2.1
修复IP风控问题,增加重试机制和随机延时
v1.2.0
- Expanded documentation with full bilingual instructions (Chinese and English). - Added detailed step-by-step login and search usage guides. - Included troubleshooting for common issues and re-login procedures. - Described directory structure and clarified file output formats. - Enhanced notes on anti-bot precautions and required environment setup.
v1.1.0
- Removed unused scripts and cached metadata files, simplifying the codebase. - Updated setup instructions in SKILL.md: removed `playwright-stealth` requirement and adjusted auth profile details. - Clarified manual login steps and revised environment variable usage in documentation.
v1.0.0
Xiaohongshu browser skill initial release. - Browse Xiaohongshu (小红书) and take screenshots of post modals. - Supports keyword-based search and returns post links with xsec_token. - Requires manual login for authentication (persistent session supported). - Outputs screenshots with images and descriptions, saved locally. - Includes setup, login, and usage instructions for first-time users.
Metadata
Slug xiaohongshu-browser
Version 1.2.1
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 4
Frequently Asked Questions

What is Xiaohongshu Browser?

Browse Xiaohongshu (小红书) and take screenshots of posts. Supports keyword search, post modal screenshots, and returns post links. Requires prior manual login. It is an AI Agent Skill for Claude Code / OpenClaw, with 199 downloads so far.

How do I install Xiaohongshu Browser?

Run "/install xiaohongshu-browser" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Xiaohongshu Browser free?

Yes, Xiaohongshu Browser is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Xiaohongshu Browser support?

Xiaohongshu Browser is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Xiaohongshu Browser?

It is built and maintained by besty0121 (@besty0121); the current version is v1.2.1.

💬 Comments