mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-22 22:26:19 +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
|
||||
.querySelector("h1.product_page")
|
||||
?.textContent?.trim();
|
||||
const imageUrl = dom.document.querySelector<HTMLImageElement>(
|
||||
".productImageZoom img"
|
||||
)?.src;
|
||||
const imageUrl =
|
||||
dom.document.querySelector<HTMLImageElement>(".zoom img")?.src;
|
||||
|
||||
return { name, imageUrl, ean, precioCentavos };
|
||||
}
|
||||
|
|
|
@ -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 })
|
||||
|
|
Loading…
Reference in a new issue