mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-11 17:29:14 +02:00
Improves GenericParser to automatically try common e-commerce selectors when the configured selector doesn't match any products. **Problem:** - Auchan and other sites return 0 products because configured selector doesn't match their current HTML structure - GenericParser was too rigid: if config selector fails, give up **Solution:** Automatic fallback selector cascade: 1. Try configured selector first (as before) 2. If no results, try 11 common e-commerce patterns: - Product URL patterns: /produit, /product, /p/, /item - Class patterns: article a, .product a, .product-card a - Generic patterns: [class*='product'] a 3. Accept first selector that finds >= 3 links 4. Log which selector worked for debugging **Selector Priority:** - Most specific first (URL patterns) - Medium specificity (semantic classes) - Generic last resort (any product-related class) **Benefits:** - ✅ Works on more sites without manual config updates - ✅ Resilient to site HTML changes - ✅ Clear logging shows which selector worked - ✅ Still uses configured selector when available - ✅ Requires >= 3 matches to avoid false positives **Expected Impact:** Sites like Auchan should now find products even if configured selector is outdated, without needing a specialized parser.