([^<]*)<\/span>/);
const priceMatch = itemHtml.match(/\s*([^<]+)<\/span>/);
categoryItems.push({
position: idMatch ? idMatch[1] : '',
categoryId: catIdMatch ? catIdMatch[1] : '',
tag: tagMatch ? tagMatch[1] : '',
image: imgMatch ? imgMatch[1] : '',
title: titleTextMatch ? titleTextMatch[1].trim() : '',
description: descMatch ? descMatch[1].trim() : '',
price: priceMatch ? priceMatch[1].trim() : ''
});
});
result.push({
categoryName,
items: categoryItems
});
});
fs.writeFileSync('public/menu.json', JSON.stringify(result, null, 2));
console.log('Saved public/menu.json');