SuperAPI AI Directory

xhs-publisher

General & other

View repository

Updated 10-15 17:30

About this skill

Xiaohongshu Publishing Skill

This skill document contains the detailed publishing process, DOM selectors, and operational steps for the Xiaohongshu Creator Platform.

Platform Overview

Platform: Xiaohongshu Creator Platform Domain: creator.xiaohongshu.com

Publishing Format Selection

Choose different publishing entry points based on content length:

Content Length Publishing Format Entry URL
< 140 characters Text with images https://creator.xiaohongshu.com/publish/publish?target=image
≥ 140 characters Image-text note https://creator.xiaohongshu.com/publish/publish?target=article

I. Text with Images Process (< 140 characters)

Process Overview

1. 导航到文字配图入口
2. 点击"文字配图"按钮
3. 输入第一张图片内容(标题)
4. 添加第二张图片并输入正文内容
5. 一次性生成全部图片
6. 选择模板样式并下一步
7. 填写发布信息(标题、正文、标签)
8. 用户确认后发布

[!IMPORTANT] Core Process: First enter all content (title + body), then generate all images at once. Do not generate each image separately!

Step 1: Navigate to the Text with Images entry point

URL: https://creator.xiaohongshu.com/publish/publish?target=image

After the page loads, the "Upload image-text" option will be displayed, containing two buttons:

  • "Upload Image" (red button)
  • "Text with Images" (gray button, with icon)

Step 2: Click the "Text with Images" button

How to find:

find: "文字配图 button"

Element characteristics:

  • Type: button
  • Text: "Text with Images"
  • Function: Enter the text-to-image editor

Action:

find("文字配图 button")
click()
wait(2)

Step 3: Enter the content of the first image (title)

Input box:

find("真诚分享经验或资讯 textbox")

Action:

find("真诚分享经验或资讯 textbox")
click()
type(title)
wait(1)

Step 4: Add a second image and enter the body content

Add second image:

find("再写一张")
click()
wait(1)

Body input box:

find("在这里输入正文 textbox")

Action:

find("在这里输入正文 textbox")
click()
type(content)
wait(1)

[!NOTE] At this point all content (title + body) has been entered, ready to generate all images at once.

Step 5: Generate all images at once

Generate Images button:

find("生成图片 button")

Action:

find("生成图片 button")
click()
wait(5)  // 等待所有图片生成,时间稍长

[!NOTE] Clicking "Generate Images" will generate both the title and body images at the same time. There is no need to click generate separately.

Step 6: Select a template style and proceed to the next step

Page characteristics:

  • Title: "Preview Images"
  • The large preview area on the left displays the generated images
  • Various template options on the right (Basic, Border, Memo, Doodle, Handwritten, Light and Shadow, Minimalist, Sticky Note, Print, Tech, etc.)
  • There is a "Next Step" button at the bottom

Template selection:

  • The "Border" template is selected by default (highlighted with a blue border)
  • You can click other templates to switch styles
  • For automated processes, it is recommended to use the default selected template

Action:

// 使用默认选中的模板
find("下一步 button")
click()
wait(2)

Step 7: Fill in publishing information

Page title: "Publish Image-Text"

7.1 Image editing area

Characteristics:

  • Displays "Image Editing (2/18)" - indicating 2 images have been added, with a maximum of 18
  • There is an "Add" button on the left to continue adding images
  • Displays thumbnails of the generated images

7.2 Fill in the title

Title input box:

find("填写标题会有更多赞哦 input")

Action:

find("填写标题会有更多赞哦 input")
form_input(title)

7.3 Fill in the complete body content and tags

Body text box:

find(包含标题的 textbox)  // 正文文本框

Important Notes:

  • The body text box will automatically fill in the content of the first image (the title)
  • Must be replaced with the complete body content(not a summary or partial content)
  • The body content includes: complete body + two line breaks + tags

Operation:

find(包含标题的 textbox)  // 正文文本框
click()
key("cmd+a")  // 全选现有内容
type(content + "\n\n" + tags)  // 填充完整正文 + 两个换行 + 标签

[!WARNING] Tag format requirements: There must betwo line breaks(\n\nbetween the body content and the tags), otherwise the tags will appear stuck to the body and look unattractive.

Tag format:

  • Use # at the beginning
  • Separate multiple tags with spaces
  • It is recommended to use no more than 3 tags
  • There must be two line breaks before the tags to separate them from the body

7.4 Other publishing options

Topic button:

find: "话题"

User button:

find: "用户"

Emoji button:

find: "表情"

Event topics:

  • The page will display the current platform's event topics
  • Format: "# 第五人格五周年春"
  • You can choose to participate

Add location:

find: "添加地点"

Add collection:

find: "添加合集"

Link group chat:

find: "选择群聊"

Step 8: Publish

Publish button:

find: "发布 button"
element_type: button
color: 红色(主要行动按钮)

Save draft button:

find: "暂存草稿 button"
element_type: button
color: 灰色(次要行动按钮)

Auto-save:

  • The page will automatically save the draft
  • Display at the bottom: "Auto-saved at HH:MM"

⚠️ Important note: According to the security policy, the automation script should:

  1. Stop after filling in all content
  2. Display a message prompting the user to review
  3. Do not automatically click the "Publish" button
  4. Let the user click "Publish" themselves in the browser

II. Image-text note process (≥ 140 characters)

Process overview

1. 导航到图文笔记入口
2. 点击"新的创作"按钮
3. 填写标题
4. 填写正文内容
5. 点击"一键排版"选择模板
6. 填写正文摘录和标签
7. 填写其他发布信息
8. 用户确认后发布

Step 1: Navigate to the image-text note entry

URL: https://creator.xiaohongshu.com/publish/publish?target=article

After the page loads, the "Write long article" page will be displayed, with the following features:

  • Main title: "Supports thousand-character long articles, full-screen reading experience"
  • Two buttons: "New creation" (red) and "Import link"
  • There is a "Long article collection" area at the bottom

Step 2: Click the "New creation" button

How to find it:

find: "新的创作 button"

Element features:

  • Type: button
  • Text: "New creation"
  • Color: red (primary action button)

Step 3: Fill in the title

After clicking "New creation", enter the long article editor.

Page features:

  • Top title: "New creation"
  • Toolbar: H₁, H₂, list, quote, image, emoji and other formatting tools
  • Two input areas: title area and body area

Title input box:

find: "输入标题"
element_type: textbox

Input method:

click(ref_51)  // 点击标题输入框
type("小红书自动发布工具使用指南")  // 输入标题

Step 4: Fill in the body content

Body editor:

// 正文编辑器是一个 generic 元素(ref_55)
// 不是标准的 textarea

Input method:

click(ref_55)  // 点击正文编辑区域
type("正文内容...")  // 输入正文

Body features:

  • Supports rich text editing
  • Word count is displayed at the bottom: "Word count: 194"
  • Auto-save feature: "Auto-saved at HH:MM"
  • Supports up to 10,000 characters

Step 5: Click "One-click formatting" to select a template

One-click formatting button:

find: "一键排版 button"

After clicking, enter the formatting preview page.

Formatting preview page features:

  • Left side: content preview (in the form of an article card)
  • Right side: Multiple template options
    • "Simple Basic" (selected by default ✓)
    • "Fresh and Bright"
    • "Black and White Minimalist"
  • Bottom: "Drag the slider to quickly locate" control

Next button:

find: "下一步 button"

Click "Next" to enter the final publishing page.

Step 6: Fill in the body content and tags

Page title: "Publish Image and Text"

Important note:

  • The image and text note has a "Body Excerpt" input box; although the name is "Excerpt", itmust be filled with the complete body content
  • is not for filling in a summary, but for filling in all the body content + tags

Body content input box:

find: "输入正文摘录 textarea"
element_type: textbox

Input method:

click(ref_194)  // 点击正文内容输入框
type(完整正文内容 + "\n\n" + 标签)  // 输入完整正文 + 标签

Content format:

  • Fill in the complete body content (not a summary)
  • After the body ends, start two new lines
  • Then add tags (# at the beginning)
  • Separate multiple tags with spaces
  • It is recommended to use no more than 3 tags

Example:

在这个信息爆炸的时代,内容创作者面临着越来越多的平台和渠道选择。小红书作为一个重要的社交电商平台,已经成为许多创作者分享生活方式和产品推荐的首选平台。

为了提高发布效率,我们开发了这款自动化发布工具。它可以帮助你快速将内容发布到小红书平台,节省大量的重复性工作时间。

本文将详细介绍如何使用这个工具,让你的内容发布工作变得更加轻松高效。无论你是个人创作者还是团队运营,这个工具都能为你带来显著的效率提升。

#小红书发布 #自动化工具 #效率提升

Step 7: Fill in other publishing information

Title input box (optional, usually auto-filled):

find: 包含标题文本的 textbox
max_length: 20字符

Cover image:

  • The system will automatically convert the long-form content into a cover image
  • Displayed in the "Image Editing" area
  • There is an "Add" button on the left to add more cover images

Other options:

  • Add location
  • Add collection
  • Link group chat
  • Activity topic (same as text with images)

Step 8: Publish

Publish button:

find: "发布 button"
element_type: button
color: 红色

Save draft button:

find: "暂存草稿 button"

⚠️ Important note: According to the security policy, the automation script should:

  1. Stop after filling in all content
  2. Display a message prompting the user to review
  3. Do not automatically click the "Publish" button
  4. Let the user click "Publish" themselves in the browser

Comparison of image and text notes vs text with images

Feature Text with images (< 140 characters) Image and text note (≥ 140 characters)
Entry URL target=image target=article
Editing method Text generates images Rich text editor
Title input Content of the first image Independent title input box
Body input Starting from the second image Body editor
Cover image Manually generate multiple images Automatically generate cover
Body area on the publish page Body text box "Body Excerpt" input box
Body filling method Complete body + tags Complete body + tags
Formatting None Supports H1/H2/lists, etc.
Character limit Recommended < 140 140-10000 characters

Key note: In both modes, the publish page must be filled with thecomplete body contentrather than a summary or partial content.

III. Common Elements and Selectors

Login Status Detection

Method 1: Check the user avatar

find: "用户头像"

If the user avatar cannot be found or a "Log in" button is displayed, it means you are not logged in.

Method 2: Check URL redirection If the URL redirects to the login page after navigating to the publishing page, it means you are not logged in.

Error Handling

Common Error Messages:

  • "Please log in first" - the user needs to log in manually
  • "Content cannot be empty" - a required field was not filled in
  • "The title cannot exceed 20 characters" - the title is too long
  • "Insufficient number of images" - at least 1 image is required

IV. Best Practices

1. Content Preparation

  • Title: concise and clear, no more than 20 characters
  • Body: clearly divided into paragraphs, use line breaks to enhance readability
  • Tags: choose highly relevant tags, 2-3 are recommended

2. Image Recommendations

  • Text with images: at least 2 (title + body)
  • Content Distribution:
    • First image: core title or question
    • Subsequent images: detailed explanation, steps, summary

3. Tag Selection

Examples of good tags:

  • #小红书发布
  • #自动化工具
  • #效率提升
  • #生活美学

Avoid:

  • Overly broad tags (such as #生活)
  • Irrelevant tags
  • More than 5 tags

4. Publishing Timing

  • Avoid frequent publishing (it is recommended to leave at least 1 hour between posts)
  • Consider user active times (8 AM, 12 PM, 8 PM)

V. Troubleshooting

Problem 1: Text input fails

Cause: Xiaohongshu uses a custom DIV editor, not a standard input/textarea

Solution:

  1. First click the text box to activate it
  2. Use type action to input text
  3. Do not use form_input(only applies to standard form elements)

Problem 2: The generate image button is not clickable

Cause: the text content is empty or too short

Solution:

  1. Make sure enough text content has been entered
  2. Wait for autosave to complete (check the "Auto-saved at" prompt at the bottom)

Problem 3: Tags are not added correctly

Cause: incorrect tag format or not using # at the beginning

Solution:

  1. Make sure the tag starts with # at the beginning
  2. Separate multiple tags with spaces
  3. There should be a space or line break after the tag

Problem 4: The page loads slowly

Cause: network latency or slow server response

Solution:

  1. Add wait time after key operations (2-3 seconds)
  2. Use screenshot to verify the page status
  3. Check the page title to confirm successful navigation

VI. Character Limits and Specifications

Field Minimum Value Maximum Value Notes
Title 1 character 20 characters Required
Body 1 character 10000 characters Required
Tags 0 3 recommended Optional
Number of images 1 image 18 images At least 1 image for text

VII. Automation precautions

Anti-automation detection

Xiaohongshu may have anti-automation mechanisms. Recommendations:

  1. Operation interval: Add a 1-3 second delay between each step
  2. Randomization: Randomize the delay time appropriately
  3. Frequency limit: Avoid frequent posting within a short period
  4. Manual review: Always let the user make the final confirmation to publish

Security

  1. Do not automatically click publish: Only fill in the content and let the user publish manually
  2. Content review: Recommend that the user preview the content
  3. Sensitive information: Avoid handling sensitive information during the automation process

VIII. Summary

This skill document provides the complete process and detailed DOM selector information for publishing Xiaohongshu text-and-image posts. The image-and-text note process needs further testing and improvement.

Core principles:

  • Text-and-image process: First enter all content (title + body), then generate all images at once
  • Use the correct entry URL
  • Execute each step in order
  • Use wait to ensure the page loads
  • Via screenshot to verify the status
  • Let the user make the final confirmation to publish