coto: trimmear titulo

This commit is contained in:
Cat /dev/Nulo 2023-12-29 20:08:01 -03:00
parent 3690f63405
commit de3bf4900c
2 changed files with 4 additions and 2 deletions

View file

@ -34,7 +34,9 @@ export function getCotoProduct(html: string | Buffer): Precioish {
const ean = getEanFromText(dom); const ean = getEanFromText(dom);
const precioCentavos = getPriceFromText(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<HTMLImageElement>( const imageUrl = dom.document.querySelector<HTMLImageElement>(
".productImageZoom img" ".productImageZoom img"
)?.src; )?.src;

View file

@ -13,7 +13,7 @@ import { DB_PATH } from "db-datos/drizzle.config.js";
import { migrateDb } from "db-datos/migrate.js"; import { migrateDb } from "db-datos/migrate.js";
const DEBUG = false; const DEBUG = false;
const PARSER_VERSION = 2; const PARSER_VERSION = 3;
migrateDb(); migrateDb();