Extend submit polling to ~30s for reCAPTCHA verification

Invisible reCAPTCHA + server round-trip can take 10-30s. Increased
from 6x2.5s (~15s) to 10x3s (~30s) polling window.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 21:45:41 -08:00
parent e28ccb627a
commit c78586926a

View File

@@ -154,8 +154,8 @@ async function fillAndSubmit(page, job, formFiller, meta, opts) {
// (invisible reCAPTCHA + server round-trip can take several seconds) // (invisible reCAPTCHA + server round-trip can take several seconds)
const verifySelector = opts.verifySelector || 'form button[type="submit"]:not([disabled])'; const verifySelector = opts.verifySelector || 'form button[type="submit"]:not([disabled])';
let postSubmit = { hasSuccess: false, hasForm: true, validationErrors: [] }; let postSubmit = { hasSuccess: false, hasForm: true, validationErrors: [] };
for (let wait = 0; wait < 6; wait++) { for (let wait = 0; wait < 10; wait++) {
await page.waitForTimeout(wait === 0 ? SUBMIT_WAIT : 2500); await page.waitForTimeout(wait === 0 ? SUBMIT_WAIT : 3000);
postSubmit = await page.evaluate((vs) => { postSubmit = await page.evaluate((vs) => {
const text = (document.body.innerText || '').toLowerCase(); const text = (document.body.innerText || '').toLowerCase();
const errorEls = document.querySelectorAll('[class*="error"], [class*="invalid"], [role="alert"]'); const errorEls = document.querySelectorAll('[class*="error"], [class*="invalid"], [role="alert"]');