diff --git a/src/scrapers/mizrahi.ts b/src/scrapers/mizrahi.ts index 2f6595ad..a50d6832 100644 --- a/src/scrapers/mizrahi.ts +++ b/src/scrapers/mizrahi.ts @@ -221,9 +221,12 @@ class MizrahiScraper extends BaseScraperWithBrowser await waitUntilElementFound(this.page, `a[href*="${TRANSACTIONS_PAGE}"]`); await this.page.$eval(`a[href*="${TRANSACTIONS_PAGE}"]`, (el) => (el as HTMLElement).click()); - const accountNumberElement = await this.page.$('#dropdownBasic b'); + const accountNumberElement = await this.page.$('#dropdownBasic b span'); const accountNumberHandle = await accountNumberElement?.getProperty('title'); const accountNumber = ((await accountNumberHandle?.jsonValue()) as string); + if (!accountNumber) { + throw new Error('Account number not found'); + } const response = await Promise.any(TRANSACTIONS_REQUEST_URLS.map(async (url) => { const request = await this.page.waitForRequest(url);