Install
openclaw skills install xhs-publisherPublish notes (posts) to Xiaohongshu (小红书) via the Creator Platform using browser automation (CDP). Use when user asks to post/publish/发布 content on Xiaohong...
openclaw skills install xhs-publisherAutomate publishing notes to Xiaohongshu (小红书) via the Creator Platform (creator.xiaohongshu.com) using browser CDP.
--remote-debugging-port)DroidSansFallbackFull.ttf) for cover image generationbrowser open → https://creator.xiaohongshu.com
browser snapshot → check if logged in (look for user avatar/name)
If not logged in, ask user to scan QR code manually. Phone number login is blocked by anti-automation detection.
browser open → https://creator.xiaohongshu.com/publish/publish
Wait for the editor to load. Look for the upload area and editor elements.
Upload image via CDP DOM.setFileInputFiles:
// Find the file input element
const fileInput = document.querySelector('input[type="file"]');
// Use CDP to set file
DOM.setFileInputFiles({ files: ['/path/to/image.jpg'], objectId: ... })
⚠️ Cover Image Text Rendering: On systems without full CJK fonts, Chinese text in generated images may show as squares (□). Solutions:
DroidSansFallbackFull.ttf for Chinese charactersUse CDP Input.insertText for reliable Chinese text input (avoids encoding issues):
// Click title input field first
// Then use CDP:
Input.insertText({ text: "你的标题" })
Title limit: 20 characters max.
Target the ProseMirror editor:
// Selector: .tiptap.ProseMirror (contenteditable div)
// Click to focus, then use Input.insertText
Supports basic formatting. For hashtags, type #话题 and select from dropdown.
Click the publish button. Use coordinate-based click (Input.dispatchMouseEvent) if selector-based click fails:
Input.dispatchMouseEvent({ type: 'mousePressed', x: X, y: Y, button: 'left', clickCount: 1 })
Input.dispatchMouseEvent({ type: 'mouseReleased', x: X, y: Y, button: 'left', clickCount: 1 })
After publishing, check for:
error_code=300031 means content was taken down (usually image issues).creator-tab:not(.active) CSS selector for switching between image/video modes| Problem | Solution |
|---|---|
| Login blocked | Use QR code scan (manual), not phone number |
| Chinese text shows □ in images | Use DroidSansFallbackFull.ttf font |
| Post taken down (300031) | Check cover image for rendering issues |
| Title input garbled | Use Input.insertText CDP method |
| Publish button unresponsive | Use coordinate-based mouse events |
| Cannot delete posts via API | Use web UI manually; API returns 404 |
To fetch user profile info:
browser open → https://www.xiaohongshu.com/user/profile/{userId}
browser snapshot → extract follower count, note count, etc.