diff --git a/app/core/search_config.py b/app/core/search_config.py index a0c9f8f..f4dae61 100644 --- a/app/core/search_config.py +++ b/app/core/search_config.py @@ -78,6 +78,14 @@ SITE_CONFIGS = { "category": "Discount", "requires_proxy": False, }, + "action.com": { + "name": "Action", + "search_url": "https://www.action.com/fr-fr/search/?q={query}", + "product_selector": "a.group[href^='/fr-fr/p/']", + "wait_selector": "a.group[href^='/fr-fr/p/']", + "category": "Discount", + "requires_proxy": False, + }, "bmstores.fr": { "name": "B&M", "wait_selector": ".product-card, .search-results", @@ -95,8 +103,8 @@ SITE_CONFIGS = { "auchan.fr": { "name": "Auchan", "search_url": "https://www.auchan.fr/recherche?text={query}", - "product_selector": "a[href*='/p-']", - "wait_selector": "a[href*='/p-']", + "product_selector": "article a[href]", + "wait_selector": "article", "category": "Grande Surface", "requires_proxy": False, }, diff --git a/verify_action.py b/verify_action.py new file mode 100644 index 0000000..1a37b33 --- /dev/null +++ b/verify_action.py @@ -0,0 +1,36 @@ +import asyncio +import logging +import sys +import os + +# Add project root to path +sys.path.append(os.getcwd()) + +from app.services.direct_search_service import direct_search_service +from app.core.search_config import SITE_CONFIGS + +# Configure logging +logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') +logger = logging.getLogger(__name__) + +async def verify_site(site_key): + logger.info(f"Verifying {site_key}...") + try: + results = await direct_search_service.search_site(site_key, "chaise") + if results: + logger.info(f"✅ {site_key}: Found {len(results)} results") + for i, res in enumerate(results[:3]): + title = res.get('title', 'No Title') + price = res.get('price', 'No Price') + url = res.get('url', 'No URL') + logger.info(f" {i+1}. {title[:50]}... - {price} - {url[:50]}...") + else: + logger.error(f"❌ {site_key}: No results found") + except Exception as e: + logger.error(f"❌ {site_key}: Error - {e}") + +async def main(): + await verify_site("action.com") + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/verify_scrapers.py b/verify_scrapers.py index f30ff37..81ff9cf 100644 --- a/verify_scrapers.py +++ b/verify_scrapers.py @@ -32,7 +32,7 @@ async def verify_site(site_key): logger.error(f"❌ {site_key}: Error - {e}") async def main(): - sites_to_test = ["gifi.fr", "stokomani.fr", "auchan.fr", "carrefour.fr", "amazon.fr"] + sites_to_test = ["gifi.fr", "stokomani.fr", "auchan.fr", "carrefour.fr", "amazon.fr", "action.com"] # Run sequentially to avoid overwhelming resources/logs for site in sites_to_test: