diff --git a/index.js b/index.js index a1a2ebe..e2a422d 100644 --- a/index.js +++ b/index.js @@ -139,12 +139,12 @@ async function scrapeWithPuppeteer(url, name) { const priceEl = node.querySelector(".s-card__price"); if (priceEl) { let txt = priceEl.textContent.replace(",", "").trim(); - txt = txt.replace("£", "GBP").replace("$", "USD"); + txt = txt.replace("£", "GBP").replace("$", ""); const match = txt.match(/([A-Za-z]{3})?\s?([\d.,]+)\s?([A-Za-z]{3})?/); if (match) { payload.currency = match[1] || match[3] || ""; payload.price = match[2] || ""; - if (!payload.currency?.trim()) payload.currency = "USD"; + if (!payload.currency?.trim()) payload.currency = "AU"; } } if (payload.id) results.push(payload); @@ -192,8 +192,8 @@ async function scrapeWithCheerio(url) { if (match) { const currency = match[1] || match[3] || ""; payload.price = match[2]; - payload.currency = currency.replace("£", "GBP").replace("$", "USD"); - if (!payload.currency?.trim()) payload.currency = "USD"; + payload.currency = currency.replace("£", "GBP").replace("$", ""); + if (!payload.currency?.trim()) payload.currency = "AU"; } if (payload.id) items.push(payload); });