{"record":{"id":"b2cfa83297c307a7","repo":"xpzouying/xiaohongshu-mcp","slug":"w-b2cfa8","errorCode":null,"errorMessage":"未找到通知条目: %w","messagePattern":"未找到通知条目: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xiaohongshu/notification_reply.go","lineNumber":43,"sourceCode":"\t\treturn nil, fmt.Errorf(\"缺少 comment_id\")\n\t}\n\tif strings.TrimSpace(content) == \"\" {\n\t\treturn nil, fmt.Errorf(\"回复内容不能为空\")\n\t}\n\n\tpage := n.page.Timeout(3 * time.Minute)\n\n\tpage.MustNavigate(\"https://www.xiaohongshu.com/notification\").MustWaitLoad()\n\thumanize.Delay(ctx, humanize.AfterNavigate)\n\n\ttarget, index, err := n.locate(ctx, page, commentID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\titems, err := page.Elements(`.tabs-content-container > .container`)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"未找到通知条目: %w\", err)\n\t}\n\tif index >= len(items) {\n\t\treturn nil, fmt.Errorf(\"通知条目渲染数(%d)少于目标位置(%d)，页面可能未加载完\", len(items), index)\n\t}\n\titem := items[index]\n\n\thumanize.Delay(ctx, humanize.Reading)\n\n\treplyBtn, err := item.Element(`.action-reply`)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"该通知没有回复入口（评论可能已删除或不可回复）: %w\", err)\n\t}\n\n\thumanize.Delay(ctx, humanize.BeforeClick)\n\tif err := humanize.Click(replyBtn); err != nil {\n\t\treturn nil, fmt.Errorf(\"无法点击回复: %w\", err)\n\t}\n\thumanize.Delay(ctx, humanize.AfterClick)","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/xpzouying/xiaohongshu-mcp/blob/332d196854a9eac0d2b8c2c0e3d0cc43139d724c/xiaohongshu/notification_reply.go#L25-L61","documentation":"After locating the comment, Reply queries the notification page DOM for items matching `.tabs-content-container > .container`. If rod cannot find any such elements it wraps the rod error with this message. This means the notification page loaded but its item list did not render in the expected structure.","triggerScenarios":"page.Elements('.tabs-content-container > .container') returns an error during Reply, typically because the notification page DOM differs from expectations (login wall, redesign, slow render).","commonSituations":"Session cookie expired so a login page rendered instead; Xiaohongshu changed frontend CSS class names; network slowness left the tab content unrendered.","solutions":["Ensure the browser session/cookies are valid and logged in to xiaohongshu.com","Retry the call — the page may not have finished rendering","Check whether Xiaohongshu changed the `.tabs-content-container > .container` selectors and update the library","Increase page timeout or add explicit wait before querying elements"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// no pre-call validation possible; verify session first\nhasLogin := checkLoginPage(browser) // ensure not on a login wall","typeGuard":null,"tryCatchPattern":"res, err := n.Reply(ctx, commentID, content)\nif err != nil && strings.Contains(err.Error(), \"未找到通知条目\") {\n    time.Sleep(2 * time.Second)\n    res, err = n.Reply(ctx, commentID, content) // retry once\n}","preventionTips":["Keep session cookies fresh and logged in","Retry transient selector misses with backoff","Pin/monitor the library against Xiaohongshu frontend changes"],"tags":["dom","selector","xiaohongshu","go-rod"],"backgroundTag":"selector-not-found","analyzedSha":"332d196854a9eac0d2b8c2c0e3d0cc43139d724c","analyzedAt":"2026-09-05T22:22:55.988Z","contentChangedAt":"2026-09-05T22:22:55.988Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}