{"record":{"id":"7fd24ded461fb3b1","repo":"xpzouying/xiaohongshu-mcp","slug":"error-7fd24d","errorCode":null,"errorMessage":"检查标题长度元素失败","messagePattern":"检查标题长度元素失败","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xiaohongshu/publish.go","lineNumber":602,"sourceCode":"\treturn nil\n}\n\n// waitAndClickTitleInput 在填写正文后等待 1 秒并回点标题输入框，增强后续交互稳定性\nfunc waitAndClickTitleInput(titleElem *rod.Element) error {\n\tslog.Info(\"正文填写完成，准备等待后回点标题输入框\")\n\ttime.Sleep(1 * time.Second)\n\tif err := humanize.Click(titleElem); err != nil {\n\t\treturn errors.Wrap(err, \"回点标题输入框失败\")\n\t}\n\tslog.Info(\"已回点标题输入框，继续后续发布流程\")\n\treturn nil\n}\n\n// 检查标题是否超过最大长度\nfunc checkTitleMaxLength(page *rod.Page) error {\n\thas, elem, err := page.Has(`div.title-container div.max_suffix`)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"检查标题长度元素失败\")\n\t}\n\n\tif !has {\n\t\treturn nil\n\t}\n\n\ttitleLength, err := elem.Text()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"获取标题长度文本失败\")\n\t}\n\n\treturn makeMaxLengthError(titleLength)\n}\n\nfunc checkContentMaxLength(page *rod.Page) error {\n\thas, elem, err := page.Has(`div.edit-container div.length-error`)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"检查正文长度元素失败\")","sourceCodeStart":584,"sourceCodeEnd":620,"githubUrl":"https://github.com/xpzouying/xiaohongshu-mcp/blob/332d196854a9eac0d2b8c2c0e3d0cc43139d724c/xiaohongshu/publish.go#L584-L620","documentation":"checkTitleMaxLength 用 page.Has 检查标题长度提示元素 div.title-container div.max_suffix 是否存在时查询报错：页面 DOM 查询失败（页面重渲染或导航中），并非标题真的超长。","triggerScenarios":"Thrown at xiaohongshu/publish.go:602 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["重试提交","确认发布页仍处于可交互状态"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}