mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-07 08:27:13 +08:00
add waitee for job list and position list; remove ka=header-job-recommend click
This commit is contained in:
+7
-7
@@ -49,17 +49,17 @@ async function mainLoop () {
|
|||||||
page.goto(recommendJobPageUrl, { timeout: 0 }),
|
page.goto(recommendJobPageUrl, { timeout: 0 }),
|
||||||
page.waitForNavigation(),
|
page.waitForNavigation(),
|
||||||
])
|
])
|
||||||
|
|
||||||
await sleepWithRandomDelay(2500)
|
|
||||||
|
|
||||||
const recommendJobLink = (await page.$('[ka=header-job-recommend]'))
|
|
||||||
await recommendJobLink.click()
|
|
||||||
|
|
||||||
const INIT_START_EXCEPT_JOB_INDEX = 0
|
const INIT_START_EXCEPT_JOB_INDEX = 0
|
||||||
let currentExceptJobIndex = INIT_START_EXCEPT_JOB_INDEX
|
let currentExceptJobIndex = INIT_START_EXCEPT_JOB_INDEX
|
||||||
afterPageLoad: while (true) {
|
afterPageLoad: while (true) {
|
||||||
|
await sleepWithRandomDelay(2500)
|
||||||
|
|
||||||
|
await Promise.all([
|
||||||
|
page.waitForSelector('.job-recommend-main .recommend-search-expect .recommend-job-btn'),
|
||||||
|
page.waitForSelector('.job-list-container .rec-job-list')
|
||||||
|
])
|
||||||
const currentActiveJobIndex = await page.evaluate(`
|
const currentActiveJobIndex = await page.evaluate(`
|
||||||
[...document.querySelectorAll('.job-recommend-search .recommend-job-btn')].findIndex(it => it.classList.contains('active'))
|
[...document.querySelectorAll('.job-recommend-main .recommend-search-expect .recommend-job-btn')].findIndex(it => it.classList.contains('active'))
|
||||||
`)
|
`)
|
||||||
|
|
||||||
const expectJobList = await page.evaluate(`document.querySelector('.job-recommend-search')?.__vue__?.expectList`)
|
const expectJobList = await page.evaluate(`document.querySelector('.job-recommend-search')?.__vue__?.expectList`)
|
||||||
|
|||||||
Reference in New Issue
Block a user