give up looking for cookie after 100 tries

master
Conduitry 4 months ago
parent 7fe2a3466e
commit cb703448fe
  1. 2
      index.js

@ -13,7 +13,7 @@ const user_agent = await page.evaluate('navigator.userAgent');
await page.goto(`https://${process.argv[2]}`);
let cf_clearance;
while (!cf_clearance) {
for (let i = 0; i < 100 && !cf_clearance; i++) {
await new Promise(res => setTimeout(res, 100));
cf_clearance = (await context.cookies()).find(({ name }) => name === 'cf_clearance');
}

Loading…
Cancel
Save