在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用xiaohongshu-reply
星标1
分支1
更新时间2026年2月16日 09:04
小红书评论回复自动化工具
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
文件资源管理器
5 个文件SKILL.md
readonly菜单
小红书评论回复自动化工具
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | xiaohongshu-reply |
| version | 1.0.0 |
| description | 小红书评论回复自动化工具 |
| metadata | {"category":"social","platform":"xiaohongshu"} |
| updated | "2026-02-10T00:00:00.000Z" |
| changelog | v1.0.0 - 从xiaohongshu-publish拆分独立,包含索引验证血泪教训 |
通过通知页面读取和回复小红书评论。
~/.openclaw/secrets/xiaohongshu.json)绝对不要用预设模板盲目回复! 必须先读取每条评论的具体内容,理解评论者的意图,再针对性地回复。
绝对不要盲信预设的按钮索引号! 通知页面的评论列表会因为:
导致"回复"按钮的索引全部偏移,回错人!
正确做法:
body.split(' 回复 ') 分割出每条评论段落# ✅ 正确:关键词验证后再发
parts = body.split(' 回复 ')
for i, part in enumerate(parts[:-1]):
if keyword.lower() in part[-150:].lower():
reply_btns[i].click()
break
# ❌ 错误:假设索引不变直接发
reply_btns[6].click() # 危险!索引可能已经偏移了
import json
from time import sleep
from playwright.sync_api import sync_playwright
cookie_path = os.path.expanduser('~/.openclaw/secrets/xiaohongshu.json')
with open(cookie_path, 'r') as f:
raw = json.load(f)
cookies = [{'name': k, 'value': str(v), 'domain': '.xiaohongshu.com', 'path': '/'} for k, v in raw.items()]
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
context = browser.new_context()
stealth_path = os.path.join(os.path.dirname(__file__), '..', 'stealth.min.js') # 项目内置
context.add_init_script(path=stealth_path)
context.add_cookies(cookies)
page = context.new_page()
page.set_default_timeout(30000)
page.goto('https://www.xiaohongshu.com/notification')
sleep(5)
try:
page.click('text=评论和@')
sleep(3)
except:
pass
body = page.text_content('body')
# 按 " 回复 " 分割,每段对应一条评论
parts = body.split(' 回复 ')
for i, part in enumerate(parts[:-1]):
snippet = part[-120:].strip()
print(f'[{i}] ...{snippet}')
评论文本结构:用户名 + 评论了你的笔记/回复了你的评论 + 时间 + 评论内容
把所有评论列出,附上拟回复内容,等主人确认。
def reply_with_verification(page, keyword, reply_text):
"""安全回复:先用关键词找到正确索引再发送"""
body = page.text_content('body')
parts = body.split(' 回复 ')
for i, part in enumerate(parts[:-1]):
if keyword.lower() in part[-150:].lower():
print(f'✅ Found "{keyword}" at index {i}')
reply_btns = page.get_by_text('回复', exact=True).all()
reply_btns[i].click()
sleep(2)
textarea = page.locator('textarea').first
textarea.fill(reply_text)
sleep(1)
page.get_by_text('发送', exact=True).first.click()
sleep(3)
return True
print(f'❌ Keyword "{keyword}" not found!')
return False
# 每条回复后重新加载页面!
for keyword, reply_text in replies_to_send:
page.goto('https://www.xiaohongshu.com/notification')
sleep(5)
try:
page.click('text=评论和@')
sleep(3)
except:
pass
reply_with_verification(page, keyword, reply_text)
soul.md 文件中定义的角色设定get_by_text('回复', exact=True)get_by_text('发送', exact=True)~/.openclaw/secrets/xiaohongshu.jsonstealth.min.js ✅ 已内置于项目根目录../xiaohongshu-publish/SKILL.md