job-pro 1.0.88 → 1.0.89
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 +22 -5
- package/package.json +1 -1
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
|
|
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
|
|
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 (
|
|
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
|
|
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 (
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "job-pro",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.89",
|
|
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",
|