mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-08 17:09:07 +08:00
deal with first job is target job so that fix a endless async loop
This commit is contained in:
+4
-1
@@ -158,7 +158,7 @@ async function mainLoop (hooks) {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
if (targetJobIndex > 0) {
|
if (targetJobIndex >= 0) {
|
||||||
// scroll that target element into view
|
// scroll that target element into view
|
||||||
await page.evaluate(`
|
await page.evaluate(`
|
||||||
targetEl = document.querySelector("ul.rec-job-list").children[${targetJobIndex}]
|
targetEl = document.querySelector("ul.rec-job-list").children[${targetJobIndex}]
|
||||||
@@ -170,6 +170,8 @@ async function mainLoop (hooks) {
|
|||||||
|
|
||||||
await sleepWithRandomDelay(200)
|
await sleepWithRandomDelay(200)
|
||||||
|
|
||||||
|
if (targetJobIndex === 0) {
|
||||||
|
} else {
|
||||||
// click that element
|
// click that element
|
||||||
await targetJobElProxy.click()
|
await targetJobElProxy.click()
|
||||||
await page.waitForResponse(
|
await page.waitForResponse(
|
||||||
@@ -183,6 +185,7 @@ async function mainLoop (hooks) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
await sleepWithRandomDelay(2000)
|
await sleepWithRandomDelay(2000)
|
||||||
|
}
|
||||||
const jobData = await page.evaluate('document.querySelector(".job-detail-box").__vue__.data')
|
const jobData = await page.evaluate('document.querySelector(".job-detail-box").__vue__.data')
|
||||||
|
|
||||||
const startChatButtonInnerHTML = await page.evaluate('document.querySelector(".job-detail-box .op-btn.op-btn-chat")?.innerHTML.trim()')
|
const startChatButtonInnerHTML = await page.evaluate('document.querySelector(".job-detail-box .op-btn.op-btn-chat")?.innerHTML.trim()')
|
||||||
|
|||||||
Reference in New Issue
Block a user