{"record":{"id":"fb1bd603b2c7d63f","repo":"xpzouying/xiaohongshu-mcp","slug":"feed-s","errorCode":null,"errorMessage":"评论未确认成功：提交后未在评论区出现（可能账号被限制或发送失败），feed: %s","messagePattern":"评论未确认成功：提交后未在评论区出现（可能账号被限制或发送失败），feed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xiaohongshu/comment_feed.go","lineNumber":82,"sourceCode":"\thumanize.Delay(ctx, humanize.AfterType)\n\n\tsubmitButton, err := page.Element(\"div.bottom button.submit\")\n\tif err != nil {\n\t\tlogrus.Warnf(\"Failed to find submit button: %v\", err)\n\t\treturn fmt.Errorf(\"未找到提交按钮: %w\", err)\n\t}\n\n\tif err := humanize.Click(submitButton); err != nil {\n\t\tlogrus.Warnf(\"Failed to click submit button: %v\", err)\n\t\treturn fmt.Errorf(\"无法点击提交按钮: %w\", err)\n\t}\n\n\thumanize.Delay(ctx, humanize.AfterClick)\n\n\t// 就地校验：提交后评论应在评论区渲染出现；未出现则判定失败，避免假成功。\n\tif !waitCommentRendered(page, content, 4*time.Second) {\n\t\tlogrus.Warnf(\"评论提交后未在评论区渲染，判定未成功: feed=%s\", feedID)\n\t\treturn fmt.Errorf(\"评论未确认成功：提交后未在评论区出现（可能账号被限制或发送失败），feed: %s\", feedID)\n\t}\n\n\tlogrus.Infof(\"Comment posted and verified to feed: %s\", feedID)\n\treturn nil\n}\n\n// commentRendered 就地读当前页评论区 DOM，判断指定文本的评论是否已渲染出现。\n// 不重新导航、不滚动——只读已加载的 .comments-container 的可见文本。\nfunc commentRendered(page *rod.Page, content string) bool {\n\tres, err := page.Eval(`(txt) => {\n\t\tconst c = document.querySelector('.comments-container');\n\t\treturn c ? c.innerText.includes(txt) : false;\n\t}`, content)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn res.Value.Bool()\n}","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/xpzouying/xiaohongshu-mcp/blob/332d196854a9eac0d2b8c2c0e3d0cc43139d724c/xiaohongshu/comment_feed.go#L64-L100","documentation":"PostComment verifies success by checking the comment actually renders in the comment list within 4 seconds (waitCommentRendered). If it never appears, the library refuses to report fake success and returns this error, noting the account may be limited or the send failed.","triggerScenarios":"Submit click succeeded mechanically but the comment was silently rejected: account shadow-banned/rate-limited, comment blocked by sensitive-word filtering, login expired so the action was discarded, or the 4s render window was too short on a slow page.","commonSituations":"Accounts under risk control after high-frequency commenting; comments containing links or flagged keywords filtered by XHS; expired session where clicks do nothing; heavy network latency exceeding the 4s verification window.","solutions":["Reduce comment frequency and let the account cool down (risk control)","Remove links/sensitive words from the comment content and retry","Re-login to refresh the session, then verify commenting works manually in a browser","Increase the verification wait if pages load slowly (library-level change to waitCommentRendered timeout)"],"exampleFix":"// before\ncount := 0\nfor { _ = svc.PostComment(ctx, feed, \"看这里 http://spam.example\") ; count++ } // triggers filtering\n// after\nif rateLimitedRecently() { return errors.New(\"cooling down\") }\n_ = svc.PostComment(ctx, feed, \"写得真好，学习了\") // clean content, throttled","handlingStrategy":"try-catch","validationCode":"// 提交前自查内容风控风险\nif strings.ContainsAny(content, \"http:/\") || utf8.RuneCountInString(content) < 2 {\n    return errors.New(\"评论含链接或过短，易被过滤\")\n}","typeGuard":null,"tryCatchPattern":"err := svc.PostComment(ctx, feedID, content)\nif err != nil && strings.Contains(err.Error(), \"评论未确认成功\") {\n    // 不要立即重试：先降频、换内容，或检查账号状态\n    log.Warnf(\"评论可能被风控过滤: %v\", err)\n    time.Sleep(10 * time.Minute)\n}","preventionTips":["降低评论频率，间隔数分钟以上","避免链接、敏感词、重复文案","定期人工浏览器验证账号评论是否正常","保持会话新鲜，过期及时重登"],"tags":["verification","comment","rate-limit","xiaohongshu","shadowban"],"backgroundTag":"comment-not-rendered-after-submit","analyzedSha":"332d196854a9eac0d2b8c2c0e3d0cc43139d724c","analyzedAt":"2026-09-05T22:22:55.988Z","contentChangedAt":"2026-09-05T22:22:55.988Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}