fix(scraper): recherche _getproduitslist actualisé

Suite à une refont de l'UI et du backend, la structure de données JSON envoyé par la page web a été simplifié.

Ancienne structure:

- `"props"->"pageProps"->"initialReduxState"->"categ"->"content->"produits"`

Nouvelle structure:

- `"props"->"pageProps"->"produits"`
This commit is contained in:
2026-03-27 21:47:06 +01:00
parent 888defb6b6
commit f5d5703e49

View File

@@ -377,13 +377,18 @@ class Scraper:
try:
data: dict[str, object] = self.getjsondata(subdir).getdata()
for element in ["initialReduxState", "categ", "content"]:
data = cast(dict[str, object], data.get(element))
# Changement dans la maniere du site stocke ses données.
#
# for element in ["initialReduxState", "categ", "content"]:
# data = cast(dict[str, object], data.get(element))
# print(data)
products: list[dict[str, Any]] = cast(
list[dict[str, Any]], data.get("products")
)
print(products)
return products
except (JSONDecodeError, HTTPError):