mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-26 11:36:20 +00:00
coto: parsear la imagen correcta
sino se captura la imagen de "OFERTA!"
This commit is contained in:
parent
f8cdbae1b3
commit
5dcc901a80
2 changed files with 3 additions and 4 deletions
|
@ -37,9 +37,8 @@ export function getCotoProduct(html: string | Buffer): Precioish {
|
||||||
const name = dom.document
|
const name = dom.document
|
||||||
.querySelector("h1.product_page")
|
.querySelector("h1.product_page")
|
||||||
?.textContent?.trim();
|
?.textContent?.trim();
|
||||||
const imageUrl = dom.document.querySelector<HTMLImageElement>(
|
const imageUrl =
|
||||||
".productImageZoom img"
|
dom.document.querySelector<HTMLImageElement>(".zoom img")?.src;
|
||||||
)?.src;
|
|
||||||
|
|
||||||
return { name, imageUrl, ean, precioCentavos };
|
return { name, imageUrl, ean, precioCentavos };
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { and, eq, sql } from "drizzle-orm";
|
||||||
import { db } from "db-datos/db.js";
|
import { db } from "db-datos/db.js";
|
||||||
|
|
||||||
const DEBUG = false;
|
const DEBUG = false;
|
||||||
const PARSER_VERSION = 3;
|
const PARSER_VERSION = 4;
|
||||||
|
|
||||||
const getPrevPrecio = db
|
const getPrevPrecio = db
|
||||||
.select({ id: schema.precios.id })
|
.select({ id: schema.precios.id })
|
||||||
|
|
Loading…
Reference in a new issue