diff --git a/lib/apply/easy_apply.mjs b/lib/apply/easy_apply.mjs
index 1ee42f4..8ac3b77 100644
--- a/lib/apply/easy_apply.mjs
+++ b/lib/apply/easy_apply.mjs
@@ -114,15 +114,15 @@ export async function apply(page, job, formFiller) {
await page.evaluate(() => window.scrollTo(0, 300)).catch(() => {});
let eaBtn = await page.waitForSelector(LINKEDIN_APPLY_BUTTON_SELECTOR, { timeout: 12000, state: 'attached' }).catch(() => null);
- // Fallback: LinkedIn shows plain "Continue" when a draft exists (not a button — a span)
- // Look for it via the apply URL pattern in the page
+ // Fallback: LinkedIn shows plain "Continue" when a draft exists (span inside an )
+ // Find the parent link and click that, or navigate to the apply URL
if (!eaBtn) {
- const continueEl = await page.$(`a[href*="/apply/"] span, [class*="apply"] span`);
- if (continueEl) {
- const text = await continueEl.evaluate(el => (el.innerText || '').trim()).catch(() => '');
- if (text === 'Continue') {
- eaBtn = continueEl;
- console.log(` ℹ️ Found "Continue" element (draft application)`);
+ const applyLink = await page.$(`a[href*="/apply/"]`);
+ if (applyLink) {
+ const text = await applyLink.evaluate(el => (el.innerText || '').trim()).catch(() => '');
+ if (/continue/i.test(text)) {
+ eaBtn = applyLink;
+ console.log(` ℹ️ Found "Continue" link (draft application)`);
}
}
}