Xiaohongshu Image Note Publishing
Overview
Use Chrome to publish a Xiaohongshu image note from a concise user idea. Follow the successful browser path: prepare a real local image file, upload it through Creator Studio, fill title and body, publish, and verify the success page.
Preconditions
- Use the
chrome:Chromeskill for browser control. - The user must already be logged in at
https://creator.xiaohongshu.com/. - The Codex Chrome Extension must have
Allow access to file URLsenabled; otherwisefileChooser.setFilesmay fail withNot allowed. - Keep image files under the current workspace and use absolute paths for upload.
- Stop for the user only for login, CAPTCHA, SMS verification, or browser/extension permission blocks.
Workflow
- Clarify the publish payload only if necessary:
- title
- body text
- image source or image prompt
- optional topics, location, visibility, schedule, originality declaration
- If the user asks for a generated image, use the
imagegenskill and copy the final image into the workspace. - Open Chrome Creator Studio:
https://creator.xiaohongshu.com/publish/publish?from=homepage&target=image
- Upload the image:
- click the visible
上传图片button - wait for
filechooser - call
chooser.setFiles([absoluteImagePath]) - wait until the editor appears with
图片编辑and title/body inputs
- click the visible
- Fill the note:
- title input placeholder:
填写标题会有更多赞哦 - body editor:
contenteditable="true" - keep copy concise and natural
- do not add random topics unless the user asks; accept platform suggestions only if useful
- title input placeholder:
- Publish:
- scroll or use a screenshot if needed to locate the red
发布button near the bottom - click
发布 - wait for and verify
发布成功
- scroll or use a screenshot if needed to locate the red
- Finalize browser tabs:
- keep the publish/success tab as
deliverableif useful - report title, body, image used, and success confirmation
- keep the publish/success tab as
Proven Chrome Pattern
Use this pattern after Chrome runtime setup:
const uploadBtn = tab.playwright.getByRole("button", { name: "上传图片", exact: true });
const chooserPromise = tab.playwright.waitForEvent("filechooser", { timeoutMs: 10000 });
await uploadBtn.click({ timeoutMs: 10000 });
const chooser = await chooserPromise;
await chooser.setFiles(["/absolute/path/to/image.png"]);
await new Promise(r => setTimeout(r, 8000));
Fill the editor:
await tab.playwright
.getByPlaceholder("填写标题会有更多赞哦", { exact: true })
.fill(title, { timeoutMs: 10000 });
await tab.playwright
.locator('[contenteditable="true"]')
.fill(body, { timeoutMs: 10000 });
Avoid These Paths
- Do not rely on pasting a public image URL into the upload area; the web publisher did not import URLs as images.
- Do not rely on image clipboard paste; the upload area did not accept image or HTML clipboard data.
- Do not use unofficial Xiaohongshu APIs unless the user explicitly provides credentials and accepts platform risk.
- Do not claim official server-side note publishing is available unless current official docs and credentials confirm it.