Detect LinkedIn Easy Apply daily limit and stop run
When LinkedIn shows "Easy Apply limit" message, detect it in the modal-open check, return rate_limited status, put job back in queue, send Telegram alert, and stop the entire run. Prevents burning retries and wasting browser sessions when rate limited. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -143,13 +143,19 @@ export async function apply(page, job, formFiller) {
|
||||
let modal = await page.waitForSelector(LINKEDIN_EASY_APPLY_MODAL_SELECTOR, { timeout: 10000 }).catch(() => null);
|
||||
|
||||
if (!modal) {
|
||||
// Check if the listing is closed
|
||||
const closed = await page.evaluate(() => {
|
||||
// Check if the listing is closed or rate limited
|
||||
const pageCheck = await page.evaluate(() => {
|
||||
const text = (document.body.innerText || '').toLowerCase();
|
||||
return text.includes('no longer accepting') || text.includes('no longer available') ||
|
||||
const closed = text.includes('no longer accepting') || text.includes('no longer available') ||
|
||||
text.includes('this job has expired') || text.includes('job is closed');
|
||||
}).catch(() => false);
|
||||
if (closed) {
|
||||
const rateLimited = text.includes('easy apply limit') || text.includes('limit easy apply');
|
||||
return { closed, rateLimited };
|
||||
}).catch(() => ({ closed: false, rateLimited: false }));
|
||||
if (pageCheck.rateLimited) {
|
||||
console.log(` ⚠️ LinkedIn Easy Apply daily limit reached`);
|
||||
return { status: 'rate_limited', meta };
|
||||
}
|
||||
if (pageCheck.closed) {
|
||||
console.log(` ℹ️ Job closed — no longer accepting applications`);
|
||||
return { status: 'closed', meta };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user