1
Fork 0

give up looking for cookie after 100 tries

This commit is contained in:
Conduitry 2022-06-08 08:23:44 -04:00
parent 7fe2a3466e
commit cb703448fe
1 changed files with 1 additions and 1 deletions

View File

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