xpzouying/xiaohongshu-mcp · warning

ErrNoFeedDetail

ErrNoFeedDetail

Error message

没有捕获到 feed 详情数据

What it means

ErrNoFeedDetail is a sentinel error returned when the note/feed detail extraction yields an empty string. extractFeedDetail (xiaohongshu/feed_detail.go:980) and getInteractState (xiaohongshu/like_favorite.go:216) return it, meaning the detail JSON or interact state could not be captured from the page.

Solutions

  1. Verify the session is logged in and the note URL is publicly accessible before extracting
  2. Capture page HTML/screenshot on failure to check whether __INITIAL_STATE__ is present; update extraction selectors if the site changed
  3. Retry the navigation once with humanized delays; a fresh page load often hydrates state
  4. Handle ErrNoFeedDetail as 'detail unavailable' and skip the note instead of failing the whole batch

Example fix

// before
detail, err := xhs.GetFeedDetail(ctx, noteID)
if err != nil { return err }
// after
detail, err := xhs.GetFeedDetail(ctx, noteID)
if errors.Is(err, errors.ErrNoFeedDetail) {
    log.Printf("note %s detail unavailable, skipping", noteID)
    return nil
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Check note accessibility expectations first
if noteID == "" { return fmt.Errorf("noteID required") }

Type guard

func isNoFeedDetail(err error) bool { return errors.Is(err, errors.ErrNoFeedDetail) }

Try / catch

detail, err := xhs.GetFeedDetail(ctx, id)
if errors.Is(err, errors.ErrNoFeedDetail) {
    return nil // skip unavailable note
} else if err != nil {
    return err
}

Prevention

When it happens

Trigger: Calling feed detail extraction or like/favorite state retrieval when the injected extraction script evaluates to an empty string — e.g. `if result == ""` branches at feed_detail.go:980 and like_favorite.go:216. Occurs when the note page did not render its state (window.__INITIAL_STATE__) or the note was deleted/hidden.

Common situations: Accessing a deleted, private, or region-locked note; page requiring login before detail data hydrates; site redesign changing the state variable or selectors so extraction returns empty; rate limiting causing a verification page instead of the note.

Related errors


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

Appendix: source

Thrown at errors/errors.go:6

package errors

import "errors"

var ErrNoFeeds = errors.New("没有捕获到 feeds 数据")
var ErrNoFeedDetail = errors.New("没有捕获到 feed 详情数据")

View on GitHub (pinned to 332d196854)