feat: Implement web scraping and search system with centralized configuration, browserless integration, and a verification script.

This commit is contained in:
Michael committed 2025-11-29 13:09:53 +01:00
1 parent 7f85a9764c
commit f976ae1127
4 files changed
+87 -25

No files matched your search

+25 -15
View File
@@ -51,6 +51,9 @@ USER_AGENT_POOL = [
# Firefox Windows
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
# Recent Chrome
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36",
]
def get_random_user_agent() -> str:
@@ -62,16 +65,16 @@ SITE_CONFIGS = {
"gifi.fr": {
"name": "Gifi",
"search_url": "https://www.gifi.fr/resultat-recherche?q={query}",
"product_selector": "a.link, .product-item a.link, .product-tile a.link",
"wait_selector": ".product-item, .product-tile, .products-grid",
"product_selector": "a.link",
"wait_selector": ".product-tile",
"category": "Discount",
"requires_proxy": False,
},
"stokomani.fr": {
"name": "Stokomani",
"search_url": "https://www.stokomani.fr/search?options%5Bprefix%5D=last&q={query}",
"product_selector": ".product-card__title a",
"wait_selector": ".product-card__title a",
"product_selector": "a.reversed-link.block",
"wait_selector": "a.reversed-link.block",
"category": "Discount",
"requires_proxy": False,
},
@@ -83,12 +86,20 @@ SITE_CONFIGS = {
},
"lafoirfouille.fr": {
"name": "La Foir'Fouille",
"search_url": "https://www.lafoirfouille.fr/catalogsearch/result/?q={query}",
"search_url": "https://www.lafoirfouille.fr/?q={query}",
"product_selector": ".product-item a.product-item-link, .product-item-info a",
"wait_selector": ".products-grid, .product-items",
"category": "Discount",
"requires_proxy": False,
},
"auchan.fr": {
"name": "Auchan",
"search_url": "https://www.auchan.fr/recherche?text={query}",
"product_selector": "a[href*='/p-']",
"wait_selector": "a[href*='/p-']",
"category": "Grande Surface",
"requires_proxy": False,
},
"centrakor.com": {
"name": "Centrakor",
"search_url": "https://www.centrakor.com/catalogsearch/result/?q={query}",
@@ -96,7 +107,7 @@ SITE_CONFIGS = {
"wait_selector": ".products-grid, .product-items",
"category": "Déco & Maison",
"requires_proxy": False,
"pre_search_selector": "text=\"C'est parti !\"",
"pre_search_selector": "button.storelocator-search__button--go",
},
"lincroyable.fr": {
"name": "L'Incroyable",
@@ -106,15 +117,6 @@ SITE_CONFIGS = {
"category": "Déco & Maison",
"requires_proxy": False,
},
"action.com": {
"name": "Action",
"search_url": "https://www.action.com/fr-fr/search/?q={query}",
"product_selector": "a[href^='/fr-fr/p/']",
"wait_selector": "a[href^='/fr-fr/p/']",
"category": "Discount",
"requires_proxy": False,
},
# === GRANDES SURFACES ===
"e.leclerc": {
"name": "E.Leclerc",
"search_url": "https://www.e.leclerc/recherche?q={query}",
@@ -123,6 +125,14 @@ SITE_CONFIGS = {
"category": "Grande Surface",
"requires_proxy": False,
},
"carrefour.fr": {
"name": "Carrefour",
"search_url": "https://www.carrefour.fr/s?q={query}",
"product_selector": "a.product-card-click-wrapper",
"wait_selector": "a.product-card-click-wrapper",
"category": "Grande Surface",
"requires_proxy": True,
},
# === E-COMMERCE GÉNÉRALISTE ===
"amazon.fr": {
"name": "Amazon France",