feat: introduce core search configuration for sites, proxies, and user agents, alongside selector diagnosis and HTML dumping utilities.

This commit is contained in:
Michael committed 2025-11-30 16:27:02 +01:00
1 parent 79dc4bfafc
commit f20bae52bd
3 files changed
+176 -22

No files matched your search

+22 -22
View File
@@ -74,9 +74,9 @@ SITE_CONFIGS = {
"stokomani.fr": {
"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, img[loading='lazy'], picture img",
"wait_selector": "a.reversed-link.block",
"product_selector": "a.reversed-link.block, a[href*='/products/']",
"product_image_selector": "img[loading='lazy'], img[class*='object'], img[sizes]",
"wait_selector": "a.reversed-link.block, .product-card",
"category": "Discount",
"requires_proxy": False,
},
@@ -92,9 +92,9 @@ SITE_CONFIGS = {
"cdiscount.com": {
"name": "Cdiscount",
"search_url": "https://www.cdiscount.com/search/10/{query}.html",
"product_selector": "a.prdtBImg[href*='/f-'][href*='.html']",
"product_image_selector": "img.prdtBImg",
"wait_selector": ".prdtBILDetails, .product-list",
"product_selector": "a.prdtBILnk, a[href*='/f-'][href*='.html']",
"product_image_selector": "img.lazy, img[data-src], img[src*='image']",
"wait_selector": ".prdtBILDetails, .prdtBIL",
"category": "E-commerce",
"requires_proxy": False,
},
@@ -139,18 +139,18 @@ SITE_CONFIGS = {
"centrakor.com": {
"name": "Centrakor",
"search_url": "https://www.centrakor.com/search/{query}",
"product_selector": "a.link.link--block",
"product_image_selector": "img.product-card__image",
"wait_selector": ".product-list, .product-item",
"product_selector": "a.link.link--block, a.product-item__link",
"product_image_selector": "img.product-card__image, img[loading='lazy'], noscript img",
"wait_selector": ".product-list, .collection__products",
"category": "Discount",
"requires_proxy": False,
},
"lincroyable.fr": {
"name": "L'Incroyable",
"search_url": "https://www.lincroyable.fr/recherche-query={query}/",
"product_selector": "a[href^='/p']",
"product_image_selector": "img.product-image",
"wait_selector": ".product-item, .product-list",
"search_url": "https://www.lincroyable.fr/recherche?query={query}",
"product_selector": "a.product-link, a[href*='/p/']",
"product_image_selector": "img[loading='lazy'], img.product-image__img, img[src*='product']",
"wait_selector": ".product-card, .products-grid",
"category": "Discount",
"requires_proxy": False,
},
@@ -158,27 +158,27 @@ SITE_CONFIGS = {
"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",
"product_selector": "a[data-testid='product-link'], a[href*='/cat/'][href*='/sku/']",
"product_image_selector": "img[data-testid='product-image'], img[src*='scene7'], img[loading='eager']",
"wait_selector": "[data-testid='product-card'], [data-testid='product-link']",
"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']",
"product_selector": "article.product-item a.product-item__name, a[class*='product-item'][href]",
"product_image_selector": "img.product-thumbnail__img, img[class*='product'][class*='img']",
"wait_selector": "article.product-item, .product-list",
"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",
"product_selector": "a[data-testid='product-card-link'], a.product-card__link",
"product_image_selector": "img[data-testid='product-card-image'], img[fetchpriority], img.ds-product-image__img",
"wait_selector": "[data-testid='product-card'], article[data-testid]",
"category": "Grande Surface",
"requires_proxy": False,
},