From 7b989f0ea01e1969f48cfe4add98b6a3e4de0497 Mon Sep 17 00:00:00 2001 From: Nulo Date: Mon, 1 Jan 2024 16:50:00 -0300 Subject: [PATCH] fixup! carrefour --- scraper/common.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scraper/common.ts b/scraper/common.ts index fbeb380..534800b 100644 --- a/scraper/common.ts +++ b/scraper/common.ts @@ -12,6 +12,10 @@ export function priceFromMeta(dom: Window) { const precioCentavos = parseFloat(precioMeta) * 100; return precioCentavos; } +export function stockFromMeta(dom: Window) { + const stockMeta = getMetaProp(dom, "product:availability"); + return stockMeta === "instock"; +} function parseJsonLds(dom: Window): object[] { const scripts = dom.window.document.querySelectorAll(