give up looking for cookie after 100 tries
This commit is contained in:
parent
7fe2a3466e
commit
cb703448fe
2
index.js
2
index.js
|
@ -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');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue