Fixed waiting for "I agree" button
This commit is contained in:
parent
28141820dc
commit
1b7632d641
1 changed files with 1 additions and 1 deletions
|
|
@ -112,7 +112,7 @@ const TIMEOUT = 20 * 1000; // 20s, default is 30s
|
||||||
const iframe = page.frameLocator('#webPurchaseContainer iframe')
|
const iframe = page.frameLocator('#webPurchaseContainer iframe')
|
||||||
await iframe.locator('button:has-text("Place Order")').click();
|
await iframe.locator('button:has-text("Place Order")').click();
|
||||||
// await page.pause();
|
// await page.pause();
|
||||||
// await iframe.locator('button:has-text("I Agree")').click();
|
await Promise.any(['button:has-text("I Agree")', '#webPurchaseContainer iframe'].map(s => page.click(s)));
|
||||||
// This is true even when there is no captcha challenge shown! That was the reason why old.stealth.js worked - it did not have this check... TODO check for hcaptcha
|
// This is true even when there is no captcha challenge shown! That was the reason why old.stealth.js worked - it did not have this check... TODO check for hcaptcha
|
||||||
// if (await iframe.frameLocator('#talon_frame_checkout_free_prod').locator('text=Please complete a security check to continue').count() > 0) {
|
// if (await iframe.frameLocator('#talon_frame_checkout_free_prod').locator('text=Please complete a security check to continue').count() > 0) {
|
||||||
// console.error('Encountered hcaptcha. Giving up :(');
|
// console.error('Encountered hcaptcha. Giving up :(');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue