feat: Add abstract base parser with product result dataclass and implement Stokomani parser for search results.

This commit is contained in:
Michael committed 2025-11-30 19:03:26 +01:00
1 parent ebe685fdf9
commit 078060f155
9 files changed
+136 -137

No files matched your search

+12 -31
View File
@@ -82,19 +82,19 @@ SITE_CONFIGS = {
},
"lafoirfouille.fr": {
"name": "La Foir'Fouille",
"search_url": "https://www.lafoirfouille.fr/recherche?controller=search&s={query}",
"product_selector": "article.product-miniature a.product-thumbnail, a.product_img_link",
"product_image_selector": "img[src], img[loading='lazy'], picture img",
"wait_selector": "article.product-miniature, .products",
"search_url": "https://www.lafoirfouille.fr/recherche?s={query}",
"product_selector": "div.product-miniature, article, div[class*='product']",
"product_image_selector": "img.product-thumbnail, img[src*='product'], img",
"wait_selector": "div.product-miniature, article, div[class*='product']",
"category": "Discount",
"requires_proxy": False,
},
"cdiscount.com": {
"name": "Cdiscount",
"search_url": "https://www.cdiscount.com/search/10/{query}.html",
"product_selector": "a.prdtBILnk, a[href*='/f-'][href*='.html']",
"product_selector": "a[class*='sc-'], a.prdtBILnk, a[href*='/f-'][href*='.html']",
"product_image_selector": "img.lazy, img[data-src], img[src*='image']",
"wait_selector": ".prdtBILDetails, .prdtBIL",
"wait_selector": "a[class*='sc-'], .prdtBILDetails, .prdtBIL",
"category": "E-commerce",
"requires_proxy": False,
},
@@ -139,37 +139,18 @@ SITE_CONFIGS = {
"centrakor.com": {
"name": "Centrakor",
"search_url": "https://www.centrakor.com/search/{query}",
"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",
"product_selector": "div.product-item, div.product-card, article",
"product_image_selector": "img.product-item__image, img.product-card__image, img[loading='lazy']",
"wait_selector": "div.product-item, div.product-card, article",
"category": "Discount",
"requires_proxy": False,
},
"lincroyable.fr": {
"name": "L'Incroyable",
"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,
},
# === GRANDES SURFACES ===
"e-leclerc.com": {
"name": "E.Leclerc",
"search_url": "https://www.e.leclerc/recherche?q={query}",
"product_selector": "a.product-card-link",
"product_image_selector": "img.product-card-image, img[class*='product-image']",
"wait_selector": ".product-card-link",
"category": "Grande Surface",
"requires_proxy": False,
},
"auchan.fr": {
"name": "Auchan",
"search_url": "https://www.auchan.fr/recherche?text={query}",
"product_selector": "article[class*='product-item'] a[href*='/p-'], div[class*='product-item'] a[href*='/p-']",
"product_image_selector": "img[class*='product-thumbnail__img'], img[class*='product-item__image']",
"wait_selector": "article[class*='product-item'], div[class*='product-item']",
"product_selector": "article, div[class*='product-card'], div[class*='list__item']",
"product_image_selector": "img[class*='product'], img[src*='auchan']",
"wait_selector": "article, div[class*='product-card'], div[class*='list__item']",
"category": "Grande Surface",
"requires_proxy": False,
},