Skip to content

Commit

Permalink
fix(mizrahi): update account number selector and add error handling (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
baruchiro authored Nov 21, 2024
1 parent 7ff5ecb commit 28fd0e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/scrapers/mizrahi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,12 @@ class MizrahiScraper extends BaseScraperWithBrowser<ScraperSpecificCredentials>
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);
Expand Down

0 comments on commit 28fd0e9

Please sign in to comment.