用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/lotosbin/project-zomboid-mods-recommend --skill xiaohongshu-publisher命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | xiaohongshu-publisher |
| description | 使用 Playwright 或浏览器自动化发布内容到小红书平台。支持登录、发布笔记、添加图片和标签。适用于需要手动登录后自动发布笔记的场景。 |
使用 Playwright 或浏览器自动化操作发布小红书笔记。
当用户要求发布内容到小红书时使用此 skill。可以是:
小红书有严格的反自动化措施:
creator.xiaohongshu.com 需要登录才能访问获取笔记内容信息:
// 先访问小红书主页,检查登录状态
await page.goto('https://www.xiaohongshu.com/explore');
await page.waitForLoadState('networkidle');
如果主页可以访问:
点击"创作中心"按钮
await page.getByRole('button', { name: '创作中心' }).click();
点击"创作服务"
await page.getByRole('link', { name: '创作服务' }).click();
在创作者平台发布
点击底部导航的"发布"
// 在主页找到发布链接
await page.getByRole('link', { name: '发布' }).click();
或者直接导航
await page.goto('https://creator.xiaohongshu.com/publish/publish?source=official');
// 填写标题
await page.getByPlaceholder('添加标题').fill('笔记标题');
// 填写正文
await page.getByRole('textbox').first().fill('笔记正文内容...');
// 添加标签
await page.getByText('#添加话题').click();
await page.getByPlaceholder('搜索话题').fill('游戏');
await page.getByText('游戏').first().click();
// 发布
await page.getByText('发布').click();
await page.waitForTimeout(2000);
const success = await page.getByText('发布成功').isVisible();
| 功能 | 选择器 |
|---|---|
| 创作中心按钮 | button:has-text("创作中心") |
| 发布按钮 | link:has-text("发布"), link[href*="publish"] |
| 标题输入 | input[placeholder*="标题"], getByPlaceholder('添加标题') |
| 正文输入 | div[contenteditable="true"], getByRole('textbox') |
| 上传图片 | input[type="file"] |
| 发布按钮 | button:has-text("发布"), getByText('发布') |
| 标签输入 | input[placeholder*="标签"] |
| 错误 | 解决方案 |
|---|---|
| 页面不见了 | 尝试从主页点击创作中心进入 |
| 未登录 | 引导用户手动登录,或使用已登录浏览器 |
| 上传失败 | 检查图片路径是否正确 |
| 发布被拒 | 检查内容是否违规 |
| 超时 | 增加等待时间 |
https://www.xiaohongshu.com/explore基于 SOC 职业分类