fish2018/pansou · warning

未找到搜索结果

Error message

未找到搜索结果

What it means

xb6v's searchImpl extracts detail-page links from the parsed results page via extractDetailURLs (links inside ul#post_container). If zero detail links are found, it throws this error: the page loaded but contained no recognizable search results.

Solutions

  1. Try a different or shorter keyword to distinguish 'no results' from a parsing problem.
  2. Enable debug mode and dump the results HTML to check whether post_container exists in the response.
  3. Update extractDetailURLs selectors if the mirror's markup changed.
  4. Check whether the site is soft-blocking (challenge page with 200) and use a different mirror or slower request rate.
Defensive patterns

Strategy: fallback

Validate before calling

// pre-trim keyword; long multi-word queries get truncated to first word by xb6v
kw := strings.Fields(keyword)
if len(kw) > 0 { keyword = kw[0] }

Try / catch

results, err := pluginSearch(keyword)
if err != nil && strings.Contains(err.Error(), "未找到搜索结果") {
	// empty result set — not fatal; try other plugins or report 'no results' to user
}

Prevention

When it happens

Trigger: The results page returned HTTP 200 and parsed fine, but the selector for ul#post_container anchor links matched nothing — an empty search, a 'no results' page rendered as 200, or the site's HTML structure changed so links no longer live in the expected container.

Common situations: Keyword genuinely has no results on the mirror; keyword optimization truncated a multi-word query to its first word, losing results; site redesign moved results out of ul#post_container; anti-bot served a soft block page with status 200.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of fish2018/pansou@beaa561337 (2026-09-07). Data as JSON: /api/errors/a5671d201a6f382a. Report an issue: GitHub.

Appendix: source

Thrown at plugin/xb6v/xb6v.go:314

	reader, err := p.getResponseReader(resp2)
	if err != nil {
		return nil, err
	}

	doc, err := goquery.NewDocumentFromReader(reader)
	if err != nil {
		return nil, fmt.Errorf("解析搜索结果HTML失败: %w", err)
	}

	// 提取搜索结果(详情页链接和日期)
	detailPages := p.extractDetailURLs(doc)

	if p.debugMode {
		log.Printf("[Xb6v] 找到 %d 个详情页链接", len(detailPages))
	}

	if len(detailPages) == 0 {
		return nil, fmt.Errorf("未找到搜索结果")
	}

	// 限制结果数量
	if len(detailPages) > MaxResults {
		detailPages = detailPages[:MaxResults]
	}

	// 并发获取详情页的磁力链接
	results := p.fetchMagnetLinksFromDetails(client, detailPages, keyword)

	// 过滤空结果
	validResults := p.filterValidResults(results)

	if p.debugMode {
		log.Printf("[Xb6v] 去除无链接结果后剩余 %d 个结果", len(validResults))
	}

	// 插件层关键词过滤(必须执行,因为跳过了Service层过滤)

View on GitHub (pinned to beaa561337)