{"record":{"id":"5892f2026eabecfe","repo":"xpzouying/xiaohongshu-mcp","slug":"w-5892f2","errorCode":null,"errorMessage":"该通知没有点赞入口（评论可能已删除或不可点赞）: %w","messagePattern":"该通知没有点赞入口（评论可能已删除或不可点赞）: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xiaohongshu/notification_like.go","lineNumber":67,"sourceCode":"\tif target.Comment.Liked == want {\n\t\tresult.Skipped = true\n\t\tlogrus.Infof(\"通知点赞跳过（已是目标状态）: comment=%s liked=%v\", commentID, want)\n\t\treturn result, nil\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\n\thumanize.Delay(ctx, humanize.Reading)\n\n\tbtn, err := items[index].Element(`.action-like .like-wrapper`)\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(btn); err != nil {\n\t\treturn nil, fmt.Errorf(\"无法点击点赞: %w\", err)\n\t}\n\n\tif err := n.waitLikeSettled(page, commentID, want); err != nil {\n\t\treturn nil, err\n\t}\n\n\thumanize.Delay(ctx, humanize.AfterInteract)\n\n\tlogrus.Infof(\"通知点赞成功: comment=%s liked=%v\", commentID, want)\n\treturn result, nil\n}\n\n// waitLikeSettled 等待点赞状态变成目标值；判不出来直接报错，不自动重试。","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/xpzouying/xiaohongshu-mcp/blob/332d196854a9eac0d2b8c2c0e3d0cc43139d724c/xiaohongshu/notification_like.go#L49-L85","documentation":"Like 在定位到的通知条目里找不到 .action-like .like-wrapper 点赞入口元素：该评论可能已被删除或本身不可点赞（无点赞按钮可渲染）。","triggerScenarios":"items[index] 存在但内部无 .action-like .like-wrapper：评论已被作者删除、该类型通知（如关注通知）本来就没有点赞按钮、前端改类名。","commonSituations":"批量点赞时遇到已删除评论的历史通知；对非评论类通知误调用 Like；小红书改版调整 action-like 结构。","solutions":["确认目标通知确实是“评论/赞”类通知，而非关注等其他类型","用 list_notifications 检查该评论是否已删除，删除则跳过","在批量流程中把该错误当作可跳过项而不是致命错误","手动检查 DOM，若改版则更新 .action-like .like-wrapper 选择器"],"exampleFix":"// before\nbtn, err := items[index].Element(`.action-like .like-wrapper`)\nif err != nil { return nil, fmt.Errorf(\"该通知没有点赞入口...: %w\", err) }\n// after\nbtn, err := items[index].Element(`.action-like .like-wrapper`)\nif err != nil {\n    log.Printf(\"跳过无点赞入口的通知: %v\", err)\n    continue // 批量场景中跳过\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"_, err := n.Like(ctx, commentID, false)\nif err != nil && strings.Contains(err.Error(), \"没有点赞入口\") {\n    // 视为可跳过项，记录后继续处理下一条\n    log.Printf(\"skip %s: no like entry\", commentID)\n    return nil\n}","preventionTips":["批量操作时把该错误当作跳过条件而非致命错误","只对评论/赞类通知调用 Like，其他类型走对应接口","用 list_notifications 先过滤掉已删除评论","改版时更新 .action-like .like-wrapper 选择器"],"tags":["go","rod","dom-selector","deleted-content"],"backgroundTag":"dom-element-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"}