From 5dcc901a80fb765995bc795f3b009616dd404768 Mon Sep 17 00:00:00 2001 From: Nulo Date: Sat, 30 Dec 2023 00:08:00 -0300 Subject: [PATCH] coto: parsear la imagen correcta sino se captura la imagen de "OFERTA!" --- scraper/parsers/coto.ts | 5 ++--- scraper/scrap.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scraper/parsers/coto.ts b/scraper/parsers/coto.ts index 621614e..96cabdb 100644 --- a/scraper/parsers/coto.ts +++ b/scraper/parsers/coto.ts @@ -37,9 +37,8 @@ export function getCotoProduct(html: string | Buffer): Precioish { const name = dom.document .querySelector("h1.product_page") ?.textContent?.trim(); - const imageUrl = dom.document.querySelector( - ".productImageZoom img" - )?.src; + const imageUrl = + dom.document.querySelector(".zoom img")?.src; return { name, imageUrl, ean, precioCentavos }; } diff --git a/scraper/scrap.ts b/scraper/scrap.ts index 61d16a5..1251ea1 100644 --- a/scraper/scrap.ts +++ b/scraper/scrap.ts @@ -10,7 +10,7 @@ import { and, eq, sql } from "drizzle-orm"; import { db } from "db-datos/db.js"; const DEBUG = false; -const PARSER_VERSION = 3; +const PARSER_VERSION = 4; const getPrevPrecio = db .select({ id: schema.precios.id })