{"record":{"id":"63a7f588d44dabef","repo":"fish2018/pansou","slug":"error-63a7f5","errorCode":null,"errorMessage":"未找到搜索结果数据","messagePattern":"未找到搜索结果数据","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/gying/gying.go","lineNumber":2506,"sourceCode":"\t\tfmt.Printf(\"[Gying] 正则匹配结果: 找到 %d 个匹配\\n\", len(matches))\n\t}\n\n\tif isLoginShell(body) {\n\t\treturn nil, fmt.Errorf(\"HTTP 403 Forbidden - 需要重新登录\")\n\t}\n\n\tif len(matches) < 2 {\n\t\tif DebugLog {\n\t\t\tfmt.Printf(\"[Gying] ❌ 未找到 _obj.search JSON数据\\n\")\n\n\t\t\t// 尝试查找是否有其他模式\n\t\t\tif strings.Contains(string(body), \"_obj.search\") {\n\t\t\t\tfmt.Printf(\"[Gying] 但是Body中包含 '_obj.search' 字符串\\n\")\n\t\t\t} else {\n\t\t\t\tfmt.Printf(\"[Gying] Body中不包含 '_obj.search' 字符串\\n\")\n\t\t\t}\n\t\t}\n\t\treturn nil, fmt.Errorf(\"未找到搜索结果数据\")\n\t}\n\n\tif DebugLog {\n\t\tjsonStr := string(matches[1])\n\t\tif len(jsonStr) > 200 {\n\t\t\tjsonStr = jsonStr[:200] + \"...\"\n\t\t}\n\t\tfmt.Printf(\"[Gying] 提取的JSON数据: %s\\n\", jsonStr)\n\t}\n\n\tvar searchData SearchData\n\tif err := json.Unmarshal(matches[1], &searchData); err != nil {\n\t\tif DebugLog {\n\t\t\tfmt.Printf(\"[Gying] JSON解析失败: %v\\n\", err)\n\t\t\tfmt.Printf(\"[Gying] 原始JSON: %s\\n\", string(matches[1]))\n\t\t}\n\t\treturn nil, fmt.Errorf(\"解析搜索数据失败: %w\", err)\n\t}","sourceCodeStart":2488,"sourceCodeEnd":2524,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/gying/gying.go#L2488-L2524","documentation":"The search response body did not match searchDataPattern — the regex that extracts the embedded _obj.search JSON — and the body was not a login shell. The plugin could not locate any search result data in the page, so it cannot return results.","triggerScenarios":"searchWithScraper parses a 200, non-login HTML page whose content lacks a matchable _obj.search JSON: empty result page rendered differently, site markup/JS changed, or an interstitial/error page served.","commonSituations":"Site frontend update changed the embedded JSON variable or its escaping; search keyword yields a special 'no results' page with different structure; anti-bot served a challenge page that isn't the standard login shell.","solutions":["Try a different keyword to rule out a special no-results page layout.","Update the plugin's searchDataPattern regex to match the site's current page structure.","Enable DebugLog to inspect the response body (it prints whether '_obj.search' appears at all).","Check whether the site serves a challenge page; if so fix the Cloudflare/session handling first."],"exampleFix":"// before\nvar searchDataPattern = regexp.MustCompile(`_obj\\.search\\s*=\\s*(\\{.*?\\});`)\n// after — match updated site markup\nvar searchDataPattern = regexp.MustCompile(`_obj\\.search\\s*=\\s*(\\{.+?\\})\\s*;?\\s*` + \"`\" + `s`)","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"results, err := p.Search(keyword)\nif err != nil && strings.Contains(err.Error(), \"未找到搜索结果数据\") {\n    // fall back: verify with a simple keyword that the site layout is unchanged\n    if probe, perr := p.Search(\"test\"); perr != nil {\n        return fmt.Errorf(\"site layout may have changed: %w\", perr)\n    }\n    return err\n}","preventionTips":["Enable DebugLog to capture response bodies when parsing breaks.","Track site frontend updates that move/rename the _obj.search blob.","Test searches with common keywords after plugin/site upgrades."],"tags":["html-parsing","regex","unexpected-response"],"backgroundTag":"unexpected-response-shape","analyzedSha":"beaa56133755a548ebc51b090b3816e2ae044aa6","analyzedAt":"2026-09-07T00:31:18.025Z","contentChangedAt":"2026-09-07T00:31:18.025Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}