From a8303d29324a38df24afb4304f4c428fd015d30b Mon Sep 17 00:00:00 2001 From: hyejungg Date: Sat, 9 Sep 2023 21:40:53 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EB=AC=B4=EC=8B=A0=EC=82=AC=20=ED=8C=8C?= =?UTF-8?q?=EC=8B=B1=20=EB=A1=9C=EC=A7=81=20(=EC=95=84=EC=9D=B4=ED=85=9C?= =?UTF-8?q?=20=EA=B0=80=EA=B2=A9)=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/parser.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/parser.js b/src/lib/parser.js index 856e528..6901839 100644 --- a/src/lib/parser.js +++ b/src/lib/parser.js @@ -82,17 +82,21 @@ const parsingForMusinsa = async (url) => { switch (ogTag) { case 'title': itemName = ogValue; - priceValue = ogValue.split(' '); break; case 'image': if (!itemImg) { itemImg = ogValue; } break; + case 'description': { + priceValue = ogValue; + const matchPrice = priceValue.match(/\d{1,3}(,\d{3})*/g); + itemPrice = matchPrice[matchPrice.length - 1]; + break; + } } } }); - itemPrice = priceValue[priceValue.length - 3]; } }); itemPrice = itemPrice ? getPriceWithoutString(itemPrice) : undefined;