when encounter the job of except company which is not active, click the no interest button

This commit is contained in:
geekgeekrun
2024-10-02 14:40:41 +08:00
parent 904d89025a
commit 4da879facc

View File

@@ -301,6 +301,65 @@ async function toRecommendPage (hooks) {
'半年前活跃',
].includes(targetJobData.bossInfo.activeTimeDesc)) {
blockBossNotActive.add(targetJobData.jobInfo.encryptUserId)
// click prevent recommend button
try {
const notSuitableFeedbackButtonProxy = await page.$('.job-detail-box .job-detail-operate .not-suitable')
if (notSuitableFeedbackButtonProxy) {
await notSuitableFeedbackButtonProxy.click()
const rawRes = await (await page.waitForResponse(
response => {
if (
response.url().startsWith('https://www.zhipin.com/wapi/zpgeek/negativefeedback/reasons.json')
) {
return true
}
return false
}
)).json();
await sleepWithRandomDelay(2000)
const chooseReasonDialogProxy = await(async() => {
const alls = await page.$$('.zp-dialog-wrap.zp-feedback-dialog.v-transfer-dom')
return alls?.[alls.length - 1]
})()
let isOptionChosen = false
if (chooseReasonDialogProxy) {
const bossNotActiveOptionProxy = await chooseReasonDialogProxy.$(`.zp-type-item[title="BOSS活跃度低"]`)
if (bossNotActiveOptionProxy) {
await bossNotActiveOptionProxy.click()
isOptionChosen = true
} else {
const recruitStoppedOptionProxy = await chooseReasonDialogProxy.$(`.zp-type-item[title="职位停招/招满"]`)
if (recruitStoppedOptionProxy) {
await recruitStoppedOptionProxy.click()
isOptionChosen = true
}
}
if (isOptionChosen) {
await sleepWithRandomDelay(1500)
const confirmButtonProxy = await chooseReasonDialogProxy.$(`.zp-dialog-footer .zp-btn.zp-btn-sure`)
await confirmButtonProxy.click()
await page.waitForResponse(
response => {
if (
response.url().startsWith('https://www.zhipin.com/wapi/zpgeek/negativefeedback/save.json')
) {
return true
}
return false
}
)
} else {
const cancelButtonProxy = await chooseReasonDialogProxy.$(`.zp-close`)
await cancelButtonProxy.click()
}
await sleepWithRandomDelay(2500)
}
}
} catch {
}
continue continueFind
}
const startChatButtonInnerHTML = await page.evaluate('document.querySelector(".job-detail-box .op-btn.op-btn-chat")?.innerHTML.trim()')