diff --git a/scraper/parsers/coto.ts b/scraper/parsers/coto.ts index 31daaee..621614e 100644 --- a/scraper/parsers/coto.ts +++ b/scraper/parsers/coto.ts @@ -34,7 +34,9 @@ export function getCotoProduct(html: string | Buffer): Precioish { const ean = getEanFromText(dom); const precioCentavos = getPriceFromText(dom); - const name = dom.document.querySelector("h1.product_page")?.textContent; + const name = dom.document + .querySelector("h1.product_page") + ?.textContent?.trim(); const imageUrl = dom.document.querySelector( ".productImageZoom img" )?.src; diff --git a/scraper/scrap.ts b/scraper/scrap.ts index 2759c74..f6928ed 100644 --- a/scraper/scrap.ts +++ b/scraper/scrap.ts @@ -13,7 +13,7 @@ import { DB_PATH } from "db-datos/drizzle.config.js"; import { migrateDb } from "db-datos/migrate.js"; const DEBUG = false; -const PARSER_VERSION = 2; +const PARSER_VERSION = 3; migrateDb();