修复猎头开关

This commit is contained in:
2026-08-26 12:16:54 +08:00
parent 1659a0b79d
commit 3b6fb297a1
3 changed files with 32 additions and 22 deletions
+10 -2
View File
@@ -65,7 +65,14 @@ _CARDS_JS = """(() => [...document.querySelectorAll('.job-card-wrap')].map(el =>
return {job_id: m ? m[1] : '', title: t('.job-name'), company: t('.boss-name'),
location: t('.company-location'), tags: t('.tag-list'),
online: !!el.querySelector('.boss-online-icon'),
hunter: [...el.querySelectorAll('span,i,em')].some(n => (n.innerText || '').trim() === '猎头')};
hunter: (() => {
// 猎头标识兼容多种渲染形式:文本节点 / alt / aria-label / class 名
if (/猎头/.test(el.innerText)) return true;
const all = [...el.querySelectorAll('*')];
return all.some(n => /猎头/.test(n.getAttribute('alt') || '')
|| /猎头/.test(n.getAttribute('aria-label') || ''))
|| all.some(n => /hunter/i.test(String(n.className)));
})()};
}))()"""
# JD 正文(详情页,明文)
@@ -401,7 +408,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.salary or '未知'} | Boss在线={card.boss_online}"
f" | 猎头={card.headhunter}")
# 薪资范围过滤(薪资来自站点分页响应明文)
if salary_min or salary_max: