mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-23 23:28:12 +02:00
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:
1 parent
b35401a87b
commit
36ae466583
4 files changed
+127
-28
No files matched your search
@@ -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 ===
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user