From 01f97140ec339c365771ba3d52089900fa670d1c Mon Sep 17 00:00:00 2001 From: Nulo Date: Fri, 22 Dec 2023 17:54:07 -0300 Subject: [PATCH] chore coto --- scraper/coto.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scraper/coto.ts b/scraper/coto.ts index 2885b41..2145634 100644 --- a/scraper/coto.ts +++ b/scraper/coto.ts @@ -19,9 +19,9 @@ function getEanFromText({ document }: Window) { } function getPriceFromText({ document }: Window) { const el = document.querySelector(".atg_store_newPrice"); - if (!el) throw new Error("no encuentro el precio"); - const nStr = el - .textContent!.trim() + if (!el?.textContent) throw new Error("no encuentro el precio"); + const nStr = el.textContent + .trim() .replace("$", "") .replaceAll(".", "") .replace(",", ".");