From 36775fade5536fbd8b2b26257c3c234f98f7cb11 Mon Sep 17 00:00:00 2001 From: mzl Date: Sun, 11 Jan 2026 12:15:20 +0800 Subject: [PATCH] ts --- xhs_crawler_core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xhs_crawler_core.py b/xhs_crawler_core.py index 78b8292..717a893 100644 --- a/xhs_crawler_core.py +++ b/xhs_crawler_core.py @@ -560,6 +560,9 @@ def resolve_profile_by_search( m = re.search(r'小红书号[::]\s*([A-Za-z0-9]+)', full_text) if m: xhs_no = m.group(1).strip() + _log(log, f"[调试{i+1}] 提取到小红书号: {xhs_no}") + else: + _log(log, f"[调试{i+1}] 未匹配到小红书号,文本前100字符: {full_text[:100]}") # 提取昵称:从开头去除干扰信息 lines = full_text.split('\n') @@ -578,7 +581,8 @@ def resolve_profile_by_search( nickname = re.sub(r'\s+', ' ', main_text).strip() else: nickname = full_text - except Exception: + except Exception as e: + _log(log, f"[调试{i+1}] 解析异常: {e}") nickname = "" xhs_no = "" else: @@ -603,9 +607,11 @@ def resolve_profile_by_search( # 精确匹配小红书号:最高优先级 if xhs_no and xhs_no.lower() == kw.lower(): score += 100 + _log(log, f"[调试{i+1}] 小红书号精确匹配!+100分") # 昵称包含关键词 if nickname and kw in nickname: score += 10 + _log(log, f"[调试{i+1}] 昵称包含关键词!+10分") # 有有效的 profile ID if _extract_profile_id_from_href(href): score += 1