56 lines
3.3 KiB
Python
56 lines
3.3 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""第二批业务列表页深挖(补充未深挖模块):组织/审批/电子合同/电子工资条/
|
|
社保参保档案/人事关系子表/绩效档案/培训记录/行政公告。
|
|
复用 dl_export 的四类入口 + 防登出授权 + 非均匀拟人间隔 + 任务中心收割。"""
|
|
import sys
|
|
sys.path.insert(0, "scripts")
|
|
import dl_export as X
|
|
|
|
# (保存路径 full_path, url, node_key) —— 大概率有真实数据+导出入口的业务列表页
|
|
DATA = [
|
|
("03_组织 / 部门管理 / 组织管理", "https://2haohr.com/org/dept/manage/home", "biz2_dept"),
|
|
("03_组织 / 岗位管理 / 岗位管理", "https://2haohr.com/org/job/job-management", "biz2_job"),
|
|
("03_组织 / 岗位管理 / 职务管理", "https://2haohr.com/org/job-system/title", "biz2_title"),
|
|
("03_组织 / 岗位管理 / 职级管理", "https://2haohr.com/org/rank", "biz2_rank"),
|
|
("08_审批 / 记录 / 审批记录", "https://2haohr.com/approval/record/list", "biz2_apprec"),
|
|
("05_社保公积金 / 常规 / 参保档案", "https://2haohr.com/social-insurance/archives", "biz2_siarch"),
|
|
("12_电子合同 / 合同签署 / 已签署", "https://2haohr.com/econtract/sign/signed", "biz2_signed"),
|
|
("12_电子合同 / 合同签署 / 合同档案库", "https://2haohr.com/econtract/archive/home", "biz2_econarch"),
|
|
("20_电子工资条 / 常规 / 发放记录", "https://2haohr.com/payslip/record", "biz2_payslip"),
|
|
("02_人事 / 员工关系 / 转正管理", "https://2haohr.com/personnel/relation/probation", "biz2_probation"),
|
|
("02_人事 / 员工关系 / 任职记录", "https://2haohr.com/personnel/relation/office", "biz2_office"),
|
|
("02_人事 / 员工关系 / 实习生管理", "https://2haohr.com/personnel/relation/internship", "biz2_intern"),
|
|
("02_人事 / 员工关系 / 培训经历", "https://2haohr.com/personnel/relation/train", "biz2_train"),
|
|
("02_人事 / 员工关系 / 沟通记录", "https://2haohr.com/personnel/relation/talk", "biz2_talk"),
|
|
("09_绩效 / 考核结果 / 员工绩效档案", "https://2haohr.com/performance-evaluation/result/archive", "biz2_perfarch"),
|
|
("09_绩效 / 考核结果 / 绩效面谈记录", "https://2haohr.com/performance-evaluation/result/interview", "biz2_interview"),
|
|
("13_培训学习 / 培训管理 / 培训记录", "https://2haohr.com/training/manage/record/list", "biz2_trainrec"),
|
|
("11_行政管理 / 常规 / 企业公告", "https://2haohr.com/oa/notice", "biz2_notice"),
|
|
]
|
|
|
|
|
|
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("=== BIZ2 补充业务列表页深挖, 共 %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("=== BIZ2 DONE 累计文件=%d ===" % len(X.SAVED))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|