Update scrap_new_items.js

This commit is contained in:
nguyentrungthat 2025-12-10 16:59:09 +07:00
parent 5f4db503e4
commit e867c48e51
1 changed files with 7 additions and 1 deletions

View File

@ -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";
}
}