From 318da35e011fca781eafc8b665d32763c4d850a6 Mon Sep 17 00:00:00 2001 From: Claw Date: Fri, 6 Mar 2026 17:04:27 +0000 Subject: [PATCH] fix: scroll page before waiting for Easy Apply button; extend timeout to 12s --- lib/apply/easy_apply.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/apply/easy_apply.mjs b/lib/apply/easy_apply.mjs index 6ea0318..77662fd 100644 --- a/lib/apply/easy_apply.mjs +++ b/lib/apply/easy_apply.mjs @@ -19,8 +19,9 @@ export async function apply(page, job, formFiller) { // Navigate to job page await page.goto(job.url, { waitUntil: 'domcontentloaded', timeout: NAVIGATION_TIMEOUT }); - // Wait for Easy Apply button to appear (up to PAGE_LOAD_WAIT) - const eaBtn = await page.waitForSelector(LINKEDIN_APPLY_BUTTON_SELECTOR, { timeout: PAGE_LOAD_WAIT }).catch(() => null); + // Scroll slightly to trigger lazy-loaded content, then wait for Easy Apply button + await page.evaluate(() => window.scrollTo(0, 300)).catch(() => {}); + const eaBtn = await page.waitForSelector(LINKEDIN_APPLY_BUTTON_SELECTOR, { timeout: 12000 }).catch(() => null); if (!eaBtn) return { status: 'skipped_easy_apply_unsupported', meta }; // Re-read meta after page settled