xpzouying/xiaohongshu-mcp · warning

该通知没有回复入口(评论可能已删除或不可回复): %w

Error message

该通知没有回复入口(评论可能已删除或不可回复): %w

What it means

After finding the target notification item, Reply looks for the `.action-reply` button inside it. If rod cannot find that element, the notification entry has no reply affordance — typically because the original comment was deleted, the thread was closed, or this notification type is not replyable. The library fails early instead of proceeding to a broken flow.

Source

Thrown at xiaohongshu/notification_reply.go:54

	target, index, err := n.locate(ctx, page, commentID)
	if err != nil {
		return nil, err
	}

	items, err := page.Elements(`.tabs-content-container > .container`)
	if err != nil {
		return nil, fmt.Errorf("未找到通知条目: %w", err)
	}
	if index >= len(items) {
		return nil, fmt.Errorf("通知条目渲染数(%d)少于目标位置(%d),页面可能未加载完", len(items), index)
	}
	item := items[index]

	humanize.Delay(ctx, humanize.Reading)

	replyBtn, err := item.Element(`.action-reply`)
	if err != nil {
		return nil, fmt.Errorf("该通知没有回复入口(评论可能已删除或不可回复): %w", err)
	}

	humanize.Delay(ctx, humanize.BeforeClick)
	if err := humanize.Click(replyBtn); err != nil {
		return nil, fmt.Errorf("无法点击回复: %w", err)
	}
	humanize.Delay(ctx, humanize.AfterClick)

	input, err := item.Element(`textarea.comment-input`)
	if err != nil {
		return nil, fmt.Errorf("回复输入框未出现: %w", err)
	}

	if err := verifyReplyTarget(input, target.from().Nickname); err != nil {
		return nil, err
	}

	if err := humanize.Type(ctx, input, content); err != nil {

View on GitHub (pinned to 332d196854)

Solutions

  1. Verify the comment still exists and is replyable in the web UI before calling Reply
  2. Skip/delete the stale commentID from your queue and continue with other replies
  3. Handle this error as non-fatal in batch reply loops (log and move on)
  4. Refresh the notification list — stale cached data may reference deleted comments
Defensive patterns

Strategy: fallback

Try / catch

_, err := n.Reply(ctx, commentID, content)
if err != nil && strings.Contains(err.Error(), "没有回复入口") {
    log.Warnf("comment %s not replyable, skipping", commentID)
    return nil // non-fatal: skip and continue
}

Prevention

When it happens

Trigger: item.Element('.action-reply') returns not-found for the located notification — comment deleted, comment disabled on that note, or notification is a like/follow (not a comment).

Common situations: User replied to a comment another user already deleted; target is a mention notification without a reply box; Xiaohongshu UI removed the reply button for restricted content.

Related errors


AI-assisted analysis of xpzouying/xiaohongshu-mcp@332d196854 (2026-09-05). Data as JSON: /api/errors/ee199bee442e9d7a. Report an issue: GitHub.