job-pro 1.0.88 → 1.0.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/apply.js CHANGED
@@ -1227,12 +1227,22 @@ export async function executeCdpRealBrowser(staged, session, target) {
1227
1227
  await new Promise((resolve) => setTimeout(resolve, 3000));
1228
1228
  return { kind: "debug" };
1229
1229
  }
1230
- // Try to click the "投递" / "立即投递" / "Apply" button to open the modal.
1230
+ // Try to click the apply button. The label patterns we see across
1231
+ // the 45 verified adapters: 投递, 立即投递, 投递简历, 在线投递, 申请,
1232
+ // 立即申请, 申请职位, 申请岗位, 网申, Apply, Apply Now, Submit
1233
+ // Application. Exclude common no-go labels like "查看投递", "我的投递",
1234
+ // "投递记录" that link to the user's history.
1231
1235
  const clickedApply = await page.evaluate(() => {
1232
- const candidates = Array.from(document.querySelectorAll('button, a'));
1236
+ const include = /(?:^|[^查我])(?:投递|申请|网申|Apply)/i;
1237
+ const exclude = /(?:查看|我的|历史|记录|状态|进度|history)/i;
1238
+ const candidates = Array.from(document.querySelectorAll('button, a, [role="button"]'));
1233
1239
  for (const el of candidates) {
1234
1240
  const t = (el.textContent ?? "").trim();
1235
- if (/^投递$|^立即投递$|^申请$|^Apply$/i.test(t)) {
1241
+ if (!t || t.length > 30)
1242
+ continue; // long labels rarely Apply buttons
1243
+ if (exclude.test(t))
1244
+ continue;
1245
+ if (include.test(t)) {
1236
1246
  el.click();
1237
1247
  return t;
1238
1248
  }
@@ -1284,12 +1294,19 @@ export async function executeCdpRealBrowser(staged, session, target) {
1284
1294
  catch (err) {
1285
1295
  steps.push({ step: "upload-resume", url: page.url(), status: 0, ok: false, message: String(err) });
1286
1296
  }
1287
- // Click the modal's submit button (typically "确认投递" / "提交").
1297
+ // Click the modal's submit button. Common labels: 确认投递, 提交,
1298
+ // 完成, 立即提交, 确认提交, Submit, Confirm. Exclude "取消", "关闭".
1288
1299
  const submittedLabel = await page.evaluate(() => {
1300
+ const include = /(?:确认投递|提交|确认提交|确认申请|完成|Submit|Confirm)/i;
1301
+ const exclude = /(?:取消|关闭|返回|Cancel|Close|Back)/i;
1289
1302
  const candidates = Array.from(document.querySelectorAll('button, [role="button"]'));
1290
1303
  for (const el of candidates) {
1291
1304
  const t = (el.textContent ?? "").trim();
1292
- if (/^(确认投递|提交|完成|Submit)$/i.test(t)) {
1305
+ if (!t || t.length > 30)
1306
+ continue;
1307
+ if (exclude.test(t))
1308
+ continue;
1309
+ if (include.test(t)) {
1293
1310
  el.click();
1294
1311
  return t;
1295
1312
  }
package/dist/index.js CHANGED
@@ -700,16 +700,20 @@ async function runCompany(adapter, company, rawArgs) {
700
700
  if (debugUrl) {
701
701
  // Route through the family-specific executor where appropriate so the
702
702
  // user can verify each step's wire format against their echo server.
703
+ // --via-cdp forces the puppeteer DOM path even in debug mode (CDP's
704
+ // debug mode just navigates the apply_url and pauses for 3s without
705
+ // submitting — useful to verify the SPA loads correctly).
703
706
  const kindForDebug = sr.schema.submit_kind ?? "multipart-anon";
704
- const debugExecutor = kindForDebug === "feishu-3-step" ? executeFeishu3Step :
705
- kindForDebug === "moka-aes" ? executeMokaApply :
706
- kindForDebug === "beisen-wecruit" ? executeBeisenWecruit :
707
- kindForDebug === "beisen-italent" ? executeBeisenITalent :
708
- kindForDebug === "cdp-real-browser" ? executeCdpRealBrowser :
709
- null;
707
+ const debugExecutor = viaCdp ? executeCdpRealBrowser :
708
+ kindForDebug === "feishu-3-step" ? executeFeishu3Step :
709
+ kindForDebug === "moka-aes" ? executeMokaApply :
710
+ kindForDebug === "beisen-wecruit" ? executeBeisenWecruit :
711
+ kindForDebug === "beisen-italent" ? executeBeisenITalent :
712
+ kindForDebug === "cdp-real-browser" ? executeCdpRealBrowser :
713
+ null;
710
714
  if (debugExecutor) {
711
715
  const result = await debugExecutor(staged, session, { kind: "debug", url: debugUrl });
712
- return emit({ mode: "debug-submit", staged, submit_kind: kindForDebug, result }, compact);
716
+ return emit({ mode: "debug-submit", staged, submit_kind: kindForDebug, via_cdp: viaCdp, result }, compact);
713
717
  }
714
718
  const result = await submitApplication(staged, { kind: "debug", url: debugUrl });
715
719
  return emit({ mode: "debug-submit", staged, submit_kind: kindForDebug, result }, compact);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "job-pro",
3
- "version": "1.0.88",
3
+ "version": "1.0.90",
4
4
  "description": "Query Chinese big-tech campus recruiting + auto-apply from your terminal. 50 companies, all 50 live (46 via official APIs, 4 via Liepin third-party fallback). 45/50 with end-to-end verified apply endpoints; 5 structurally-external (Liepin IM × 4 + Unitree WeChat). No signup, no token, no server.",
5
5
  "homepage": "https://job.ha7ch.com",
6
6
  "repository": "https://github.com/HA7CH/job-pro",