Skip to content

Commit

Permalink
Update src/scrapers/yahav.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
baruchiro authored Sep 5, 2024
1 parent 9f11291 commit 03b1c5e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/scrapers/yahav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@ function getPossibleLoginResults(page: Page): PossibleLoginResults {

async function getAccountID(page: Page): Promise<string> {
try {
// Attempt to extract the account ID using the selector
const selectedSnifAccount = await page.$eval(ACCOUNT_ID_SELECTOR, (element: Element) => {
return element.textContent as string;
});

return selectedSnifAccount;
} catch (error) {
// Handle the case where the selector is outdated or the element is not found
const errorMessage = error instanceof Error ? error.message : String(error);
throw new Error(`Failed to retrieve account ID. Possible outdated selector. ${errorMessage}`);
throw new Error(`Failed to retrieve account ID. Possible outdated selector '${ACCOUNT_ID_SELECTOR}: ${errorMessage}`);
}
}

Expand Down

0 comments on commit 03b1c5e

Please sign in to comment.