修复猎头标识
This commit is contained in:
@@ -167,6 +167,8 @@ class Applicant:
|
||||
self._tab: dict | None = None
|
||||
self._sess: CDPSession | None = None
|
||||
self._salary_by_id: dict[str, str] = {}
|
||||
# 招聘者职位(来自分页响应 bossTitle,猎头判定依据)
|
||||
self._boss_title_by_id: dict[str, str] = {}
|
||||
# 公司黑名单(每次任务开始时从云端拉取)
|
||||
self._blacklist: set[str] = set()
|
||||
|
||||
@@ -328,6 +330,11 @@ class Applicant:
|
||||
for j in jobs:
|
||||
if j.get("encryptJobId"):
|
||||
self._salary_by_id[j["encryptJobId"]] = j.get("salaryDesc") or ""
|
||||
# 猎头判定依据:招聘者职位(如"猎头顾问");goldHunter 为金猎头标识
|
||||
title = j.get("bossTitle") or ""
|
||||
if j.get("goldHunter"):
|
||||
title = title or "猎头"
|
||||
self._boss_title_by_id[j["encryptJobId"]] = title
|
||||
logger.debug(f"捕获分页响应:{len(jobs)} 个职位,薪资表累计 {len(self._salary_by_id)} 条")
|
||||
except Exception:
|
||||
pass
|
||||
@@ -345,6 +352,10 @@ class Applicant:
|
||||
if not it.get("job_id"):
|
||||
continue
|
||||
it["salary"] = self._salary_by_id.get(it["job_id"], "")
|
||||
# 猎头判定:优先用分页响应 bossTitle(页面卡片上无可靠标识)
|
||||
boss_title = self._boss_title_by_id.get(it["job_id"], "")
|
||||
it["hunter"] = "猎头" in boss_title or bool(it.get("hunter"))
|
||||
it["boss_title"] = boss_title
|
||||
cards.append(JobCard(
|
||||
job_id=it.get("job_id", ""), title=it.get("title", ""),
|
||||
company=it.get("company", ""), location=it.get("location", ""),
|
||||
@@ -409,7 +420,8 @@ class Applicant:
|
||||
self.stats["current"] = f"评估:{card.company} - {card.title}"
|
||||
logger.debug(f"开始处理卡片:{card.company} - {card.title}"
|
||||
f" | 薪资={card.salary or '未知'} | Boss在线={card.boss_online}"
|
||||
f" | 猎头={card.headhunter}")
|
||||
f" | 猎头={card.headhunter}"
|
||||
f" | 招聘者={self._boss_title_by_id.get(card.job_id, '未知')}")
|
||||
|
||||
# 薪资范围过滤(薪资来自站点分页响应明文)
|
||||
if salary_min or salary_max:
|
||||
|
||||
Reference in New Issue
Block a user