From e986510471c3abd365ca110431c56dc2f2c41ffb Mon Sep 17 00:00:00 2001 From: Scott Robinson Date: Tue, 16 Feb 2021 19:56:30 +1100 Subject: [PATCH] Wait for the keypad itself to appear, as waiting for the keypad image requests can timeout --- src/index.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index a236ce4..1b2008f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,11 +4,7 @@ import { PNG } from 'pngjs' export async function login(page: Page, clientNumber: string, accessCode: string): Promise { await page.goto('https://www.ing.com.au/securebanking/') - await page.waitForResponse('https://www.ing.com.au/KeypadService/v1/KeypadService.svc/json/PinpadImages') - // we wait for a second request, but only if it comes within 2 seconds - await page - .waitForResponse('https://www.ing.com.au/KeypadService/v1/KeypadService.svc/json/PinpadImages', { timeout: 2000 }) - .catch(() => {}) + await page.waitForSelector('#loginInput') await page.type('#cifField', clientNumber) const randomisedKeys = await page.$$eval('.pin > img', imgs =>