fix: waitForSelector on modal after click instead of fixed 1.5s delay
This commit is contained in:
@@ -39,11 +39,9 @@ export async function apply(page, job, formFiller) {
|
||||
}));
|
||||
Object.assign(meta, pageMeta);
|
||||
|
||||
// Click Easy Apply
|
||||
// Click Easy Apply and wait for modal to appear
|
||||
await page.click(LINKEDIN_APPLY_BUTTON_SELECTOR, { timeout: APPLY_CLICK_TIMEOUT }).catch(() => {});
|
||||
await page.waitForTimeout(CLICK_WAIT);
|
||||
|
||||
const modal = await page.$(LINKEDIN_EASY_APPLY_MODAL_SELECTOR);
|
||||
const modal = await page.waitForSelector(LINKEDIN_EASY_APPLY_MODAL_SELECTOR, { timeout: 8000 }).catch(() => null);
|
||||
if (!modal) return { status: 'no_modal', meta };
|
||||
|
||||
// Step through modal
|
||||
|
||||
Reference in New Issue
Block a user