{"record":{"id":"9f195feae629a332","repo":"xpzouying/xiaohongshu-mcp","slug":"errnofeeds","errorCode":"ErrNoFeeds","errorMessage":"没有捕获到 feeds 数据","messagePattern":"没有捕获到 feeds 数据","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"errors/errors.go","lineNumber":5,"sourceCode":"package errors\n\nimport \"errors\"\n\nvar ErrNoFeeds = errors.New(\"没有捕获到 feeds 数据\")\nvar ErrNoFeedDetail = errors.New(\"没有捕获到 feed 详情数据\")\n","sourceCodeStart":1,"sourceCodeEnd":7,"githubUrl":"https://github.com/xpzouying/xiaohongshu-mcp/blob/332d196854a9eac0d2b8c2c0e3d0cc43139d724c/errors/errors.go#L1-L7","documentation":"ErrNoFeeds is a sentinel error (errors.New) indicating the scraper captured an empty string instead of feeds data after extracting from the page. GetFeedsList and Search return it when their result variable is empty, meaning the DOM selectors or the extraction pipeline found nothing. It signals the page data was not captured, not a network failure per se.","triggerScenarios":"Calling xiaohongshu GetFeedsList or Search when the extraction JS evaluates to an empty string — e.g. xiaohongshu/feeds.go:57 and xiaohongshu/search.go:157 both do `if result == \"\" { return nil, errors.ErrNoFeeds }`. Typically after a keyword search that returns no notes, or when the page layout changed so the extraction script returns empty.","commonSituations":"Searching a keyword with no results; XHS requiring login/verification so feeds render nothing; anti-bot interception returning an empty shell page; frontend redesign changing selectors so the injected extraction script yields empty output.","solutions":["Check that the user session is logged in and not hit by a verification wall before calling GetFeedsList/Search","Log the page HTML when this occurs and update the extraction selectors in xiaohongshu/feeds.go / search.go if the site markup changed","Retry with a different keyword or after a delay/humanized navigation (humanize.Hover/Click) to appear less bot-like","Treat empty results as a valid business outcome: handle ErrNoFeeds as 'no data' rather than retrying blindly"],"exampleFix":"// before\nfeeds, err := xhs.GetFeedsList(ctx, keyword)\nif err != nil { log.Fatal(err) }\n// after\nfeeds, err := xhs.GetFeedsList(ctx, keyword)\nif errors.Is(err, errors.ErrNoFeeds) {\n    log.Println(\"no feeds for keyword, skipping\")\n    return nil\n} else if err != nil {\n    log.Fatal(err)\n}","handlingStrategy":"try-catch","validationCode":"// Go: no pre-validation possible for page data; guard at call site\nif keyword == \"\" { return fmt.Errorf(\"keyword required\") }","typeGuard":"func isNoFeeds(err error) bool { return errors.Is(err, errors.ErrNoFeeds) }","tryCatchPattern":"feeds, err := xhs.GetFeedsList(ctx, kw)\nswitch {\ncase errors.Is(err, errors.ErrNoFeeds):\n    log.Printf(\"no feeds for %q\", kw) // business-empty, not failure\ncase err != nil:\n    return err\n}","preventionTips":["Ensure the session is logged in before scraping","Treat ErrNoFeeds as empty results, not a fatal error","Log page HTML on failure to detect selector drift early"],"tags":["scraping","empty-result","xiaohongshu"],"backgroundTag":"empty-scrape-result","analyzedSha":"332d196854a9eac0d2b8c2c0e3d0cc43139d724c","analyzedAt":"2026-09-05T22:22:55.988Z","contentChangedAt":"2026-09-05T22:22:55.988Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}