first commit

This commit is contained in:
Michelle Zan
2026-09-03 15:35:23 +08:00
commit 9b26161bcf
510 changed files with 29402 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""业务数据列表页导出深挖:各模块有真实数据的列表页(花名册/工资表/账单/考勤明细等)
触发导出(类型B: #icon-export / 文字“导出”) -> 异步任务中心 -> 统一收割落盘。
复用 dl_export 的安全逻辑(防登出授权处理 + 非均匀拟人间隔 + 四类入口)。"""
import sys, time
sys.path.insert(0, "scripts")
import dl_export as X
# (保存路径 full_path, url, node_key) —— 各模块有真实数据的业务列表页
DATA = [
("02_人事 / 员工管理 / 员工花名册", "https://2haohr.com/personnel/employee/roster", "biz_roster"),
("02_人事 / 员工管理 / 员工档案库", "https://2haohr.com/personnel/employee/archive", "biz_arch"),
("02_人事 / 员工管理 / 万能人事表格", "https://2haohr.com/personnel/employee/personnel-form", "biz_form"),
("02_人事 / 员工关系 / 入职管理", "https://2haohr.com/personnel/relation/enrollment", "biz_enroll"),
("02_人事 / 员工关系 / 离职管理", "https://2haohr.com/personnel/relation/departure", "biz_depart"),
("02_人事 / 员工关系 / 合同管理", "https://2haohr.com/personnel/relation/contract", "biz_contract"),
("02_人事 / 员工关系 / 奖惩记录", "https://2haohr.com/personnel/relation/award", "biz_award"),
("02_人事 / 员工关系 / 人事异动", "https://2haohr.com/personnel/relation/unusual-action", "biz_unusual"),
("06_薪酬 / 薪酬管理 / 月工资表", "https://2haohr.com/payroll/salary/monthly", "biz_monthly"),
("06_薪酬 / 薪酬管理 / 员工薪资", "https://2haohr.com/payroll/salary/profiles", "biz_profiles"),
("06_薪酬 / 薪酬管理 / 工资发放", "https://2haohr.com/payroll/salary/payoff", "biz_payoff"),
("05_社保公积金 / 常规 / 参保账单", "https://2haohr.com/social-insurance/records", "biz_sirec"),
("05_社保公积金 / 常规 / 账单核对", "https://2haohr.com/social-insurance/bill", "biz_sibill"),
("04_考勤假期 / 考勤统计 / 月考勤表", "https://2haohr.com/attendance/stat/monthly", "biz_kqmonth"),
("04_考勤假期 / 考勤统计 / 明细记录", "https://2haohr.com/attendance/stat/records", "biz_kqrec"),
("04_考勤假期 / 考勤统计 / 每日考勤", "https://2haohr.com/attendance/stat/daily", "biz_kqday"),
("04_考勤假期 / 假期管理 / 休假一览", "https://2haohr.com/attendance/holiday/leaveRecords", "biz_leave"),
("04_考勤假期 / 假期管理 / 假期余额", "https://2haohr.com/attendance/holiday/balance", "biz_balance"),
("03_组织 / 岗位管理 / 员工标签", "https://2haohr.com/org/tag/emp-tags", "biz_tag"),
("07_绩效 / 考核结果 / 绩效考核记录", "https://2haohr.com/performance-evaluation/result/assessment", "biz_perfrec"),
]
def main():
X.ensure()
X.call("find_tab", {"url": "2haohr.com"})
pages = [{"full_path": a, "url": b, "node_key": c, "screenshot_path": None} for a, b, c in DATA]
X.log("=== BIZ 业务列表页深挖, 共 %d 页 ===" % len(pages))
aborted = False
for i, p in enumerate(pages, 1):
try:
n = X.process_page(p, i, len(pages))
if n == -1:
X.log("=== 登录态失效, 中止 ===")
aborted = True
break
except Exception as e:
X.log(" 页面异常: %s" % str(e)[:100])
X.human_delay("page")
if not aborted:
X.log("=== 收割任务中心 stage2=%d ===" % X.harvest_task_center())
X.log("=== BIZ DONE 累计文件=%d ===" % len(X.SAVED))
if __name__ == "__main__":
main()