From 7a730f689ec9c02a546226b19a2db1aeb95b1e57 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Fri, 6 Mar 2026 12:28:50 -0800 Subject: [PATCH] Use networkidle for job page navigation to fix intermittent button miss domcontentloaded fires before JS renders the Easy Apply button, causing flaky "No Easy Apply button found" failures on valid listings. Co-Authored-By: Claude Opus 4.6 --- lib/apply/easy_apply.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/apply/easy_apply.mjs b/lib/apply/easy_apply.mjs index 1fb8049..7a99c67 100644 --- a/lib/apply/easy_apply.mjs +++ b/lib/apply/easy_apply.mjs @@ -131,8 +131,8 @@ async function findApplyModal(page) { export async function apply(page, job, formFiller) { const meta = { title: job.title, company: job.company }; - // Navigate to job page - await page.goto(job.url, { waitUntil: 'domcontentloaded', timeout: NAVIGATION_TIMEOUT }); + // Navigate to job page — networkidle ensures JS has rendered the Easy Apply button + await page.goto(job.url, { waitUntil: 'networkidle', timeout: NAVIGATION_TIMEOUT }); // Scroll slightly to trigger lazy-loaded content, then wait for Easy Apply button await page.evaluate(() => window.scrollTo(0, 300)).catch(() => {});