From 65162298c55a7c085112260b6e6e80929c5de421 Mon Sep 17 00:00:00 2001 From: caibotmini Date: Mon, 6 Apr 2026 23:29:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20v0.0.3=20-=20=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【post_type 分类优化】 - 有"出"、"售"、"卖" → 出售(deal) - 有"收"、"求"、"购"、"要" → 求购(want) - 有"确认"、"朋友"、"投诉" → 其他(normal) - else → 出售(deal) # 默认改为出售 【category 分类优化】 - 优先级:龙钞 > 马钞 > 蛇钞 > 其他 - 龙钞:含"龙"、"龙钞"、"小龙钞"、"钞王" - 马钞:含"马"、"马钞" - 蛇钞:含"蛇"、"蛇钞" - 其他:以上都不是 【历史数据清洗】 - 重新分类 1813 条 post_type - 重新分类全量 category 数据 --- crawlers/crawl_today.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/crawlers/crawl_today.py b/crawlers/crawl_today.py index 90bc784..8f41231 100644 --- a/crawlers/crawl_today.py +++ b/crawlers/crawl_today.py @@ -166,21 +166,28 @@ class YichensTodaySpider(PaginationSpider): if "标百" in title: special_types.append("标百") - post_type = "normal" + # post_type 分类逻辑:出售 > 求购 > 其他 > 默认出售 if title: - if any(c in title for c in ["出", "售", "卖", "兑"]): + if any(c in title for c in ["出", "售", "卖"]): post_type = "deal" - elif any(c in title for c in ["求", "收", "购"]): + elif any(c in title for c in ["收", "求", "购", "要"]): post_type = "want" + elif any(c in title for c in ["确认", "朋友", "投诉"]): + post_type = "normal" + else: + post_type = "deal" # 默认出售 + else: + post_type = "normal" + # category 分类逻辑(优先级:龙钞 > 马钞 > 蛇钞 > 其他) category = "其他" if title: - if "龙钞" in title or "龙纪念" in title: + if any(c in title for c in ["龙", "龙钞", "小龙钞", "钞王"]): category = "龙钞" - elif "蛇钞" in title: - category = "蛇钞" - elif "马钞" in title: + elif any(c in title for c in ["马", "马钞"]): category = "马钞" + elif any(c in title for c in ["蛇", "蛇钞"]): + category = "蛇钞" # 从 postuserinfo div 的 标签提取用户名(跳过电话号码) if not author: