diff --git a/src/scrapers/yahav.ts b/src/scrapers/yahav.ts index 32db4e89..798d9329 100644 --- a/src/scrapers/yahav.ts +++ b/src/scrapers/yahav.ts @@ -61,15 +61,14 @@ function getPossibleLoginResults(page: Page): PossibleLoginResults { async function getAccountID(page: Page): Promise { 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}`); } }