Publish content to Weibo through browser automation on m.weibo.cn (mobile web version).
/tmp/openclaw/uploads/ before uploadbrowser open https://m.weibo.cn/compose
Get snapshot to find textbox ref, then type content:
// Example: Post text
browser act kind=type ref=<textbox-ref> text="Your post content here"
Important: Images must be in /tmp/openclaw/uploads/ directory.
# Prepare image (example)
cp /path/to/image.png /tmp/openclaw/uploads/
Upload using the upload button ref (not the hidden file input):
// Upload image - use the upload button ref
browser upload inputRef=<upload-button-ref> paths=["/tmp/openclaw/uploads/image.png"]
// Wait 2-3 seconds for upload to complete
// Take screenshot to verify preview appears
Verification: Wait 2-3 seconds, then screenshot to confirm image preview is visible on page.
Click the send button:
browser act kind=click ref=<send-button-ref>
Do NOT rely on page redirect - compose page stays open.
Verification steps:
```
browser open https://m.weibo.cn
browser act kind=click ref=
```
```
browser action=close targetId=
```
After successful publication, clean up temporary files:
# Remove uploaded image from temp directory
rm /tmp/openclaw/uploads/<filename>
# Optional: Clean up browser screenshots older than 7 days
find ~/.openclaw/media/browser/ -type f -mtime +7 -delete
Note: Temporary files are NOT automatically cleaned up. Cleanup is required - always run it after publishing.
Common refs on m.weibo.cn/compose:
ref=e15 (textbox "分享新鲜事…")ref=e10 ("发送")ref=e25 or ref=e29 ( icon)Note: Refs are dynamic - always get fresh snapshot before interacting.
| Issue | Solution |
|---|---|
| ------- | ---------- |
| Image upload shows "图片选择失败" | File not in /tmp/openclaw/uploads/. Move file to correct location. |
| Send button not responding | Check if textbox is empty. Weibo requires at least text or image. |
| Post not appearing after 5s | Wait longer (network delay) or check login status. |
See references/workflow-examples.md for complete code examples.
共 1 个版本