feat: Introduce ImprovedSearchService utilizing Playwright for persistent browser-based e-commerce scraping and price extraction, along with new search configuration.

This commit is contained in:
Michael committed 2025-12-01 01:30:06 +01:00
1 parent b35401a87b
commit 36ae466583
4 files changed
+127 -28

No files matched your search

+18
View File
@@ -176,6 +176,24 @@ SITE_CONFIGS = {
"category": "Grande Surface",
"requires_proxy": False,
},
"action.com": {
"name": "Action",
"search_url": "https://www.action.com/fr-fr/search/?q={query}",
"product_selector": "div.product-card, div.card",
"product_image_selector": "img",
"wait_selector": "div.product-card, div.card",
"category": "Discount",
"requires_proxy": True,
},
"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",
"wait_selector": "a.product-card-link",
"category": "Grande Surface",
"requires_proxy": False,
},
}
# === COOKIE BANNERS ===
+1 -1
View File
@@ -11,7 +11,7 @@ from typing import AsyncGenerator, Optional
from urllib.parse import quote_plus, urljoin, urlparse
from bs4 import BeautifulSoup
from playwright.async_api import Browser, BrowserContext, Page, async_playwright
from playwright.async_api import Browser, BrowserContext, Page, async_playwright, TimeoutError as PlaywrightTimeoutError
from sqlalchemy.orm import Session
from app.models import SearchSite