feat: Implement centralized search configuration with site definitions, proxy settings, and user agents, and add a debugging script.

This commit is contained in:
Michael committed 2025-11-30 15:58:27 +01:00
1 parent 7477d505e5
commit 79dc4bfafc
3 files changed
+199 -14

No files matched your search

+32 -4
View File
@@ -66,7 +66,7 @@ SITE_CONFIGS = {
"name": "Gifi",
"search_url": "https://www.gifi.fr/resultat-recherche?q={query}",
"product_selector": "a.link",
"product_image_selector": "img.tile-image",
"product_image_selector": "img.tile-image, img[class*='product'], picture img",
"wait_selector": ".product-tile",
"category": "Discount",
"requires_proxy": False,
@@ -75,7 +75,7 @@ SITE_CONFIGS = {
"name": "Stokomani",
"search_url": "https://www.stokomani.fr/search?options%5Bprefix%5D=last&q={query}",
"product_selector": "a.reversed-link.block",
"product_image_selector": "img.object-cover",
"product_image_selector": "img.object-cover, img[loading='lazy'], picture img",
"wait_selector": "a.reversed-link.block",
"category": "Discount",
"requires_proxy": False,
@@ -84,7 +84,7 @@ SITE_CONFIGS = {
"name": "Action",
"search_url": "https://www.action.com/fr-fr/search/?q={query}",
"product_selector": "a.group[href^='/fr-fr/p/']",
"product_image_selector": "img[loading='lazy']",
"product_image_selector": "img[loading='lazy'], img[src*='product'], picture img",
"wait_selector": "a.group[href^='/fr-fr/p/']",
"category": "Discount",
"requires_proxy": False,
@@ -121,7 +121,7 @@ SITE_CONFIGS = {
"name": "Fnac",
"search_url": "https://www.fnac.com/SearchResult/ResultList.aspx?Search={query}",
"product_selector": "a.Article-title[href*='/a']",
"product_image_selector": "img.Article-itemVisual",
"product_image_selector": "img.Article-itemVisual, img[data-src], img[src*='product'], picture img",
"wait_selector": ".Article-item, .Article-list",
"category": "Culture & Tech",
"requires_proxy": False,
@@ -154,6 +154,34 @@ SITE_CONFIGS = {
"category": "Discount",
"requires_proxy": False,
},
# === GRANDES SURFACES ===
"e-leclerc.com": {
"name": "E.Leclerc",
"search_url": "https://www.e-leclerc.com/recherche?text={query}",
"product_selector": "a[href*='/produit'], a.product-card, article a",
"product_image_selector": "img[loading='lazy'], img[src*='scene7'], picture img",
"wait_selector": ".product-card, .search-results, article",
"category": "Grande Surface",
"requires_proxy": False,
},
"auchan.fr": {
"name": "Auchan",
"search_url": "https://www.auchan.fr/search?text={query}",
"product_selector": "a[href*='/p-'], a.product-card, a[data-testid*='product']",
"product_image_selector": "img.product-image, img[loading='lazy'], picture img",
"wait_selector": ".product-card, .product-item, [data-testid*='product']",
"category": "Grande Surface",
"requires_proxy": False,
},
"carrefour.fr": {
"name": "Carrefour",
"search_url": "https://www.carrefour.fr/s?q={query}",
"product_selector": "a[data-testid='product-card-link'], a[href*='/p/']",
"product_image_selector": "img[data-testid='product-card-image'], img[loading='lazy'], picture img",
"wait_selector": "[data-testid='product-card'], .product-card",
"category": "Grande Surface",
"requires_proxy": False,
},
}
# === COOKIE BANNERS ===