From e867c48e51fd3d4919ea940397452c6bbf9230ef Mon Sep 17 00:00:00 2001 From: nguyentrungthat <80239428+nguentrungthat@users.noreply.github.com> Date: Wed, 10 Dec 2025 16:59:09 +0700 Subject: [PATCH] Update scrap_new_items.js --- scrap_new_items.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scrap_new_items.js b/scrap_new_items.js index 69616e0..aa112b8 100644 --- a/scrap_new_items.js +++ b/scrap_new_items.js @@ -152,7 +152,13 @@ async function scrapeWithPuppeteer(store) { if (match) { payload.currencyID = match[1] || match[3] || ""; payload.price = match[2] || ""; - if (!payload.currency?.trim()) payload.currency = "AU"; + if (!payload.currencyID?.trim()) { + const match1 = text.match(/([A-Za-z]{2,3})\s?([\d.]+)/); + if (match1) { + payload.currencyID = match[1] || match[3] || ""; + } + } + if (!payload.currencyID?.trim()) payload.currency = "AU"; } }