mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-12 01:39:25 +02:00
1.5 KiB
1.5 KiB
Walkthrough: Price Extraction & Catalog Fixes
1. Vision Priority Strategy
Problem: The AI was prioritizing text data (often hidden/outdated) over the visual price on the screenshot, extracting incorrect prices (e.g. 0.99€ instead of 1.27€).
Solution:
- Prompt Engineering: Rewrote the system prompt in
ai_schema.pyto explicitly declare the IMAGE AS THE SOURCE OF TRUTH. - Logic Fix: Disabled the
AIPriceExtractor(Text-only AI) inscheduler_service.pywhich was short-circuiting the logic before the Vision AI could run.
2. Catalog Scraper Fix (Connectivity)
Problem: Catalogs were not updating because the browserless service was failing (likely blocked or network issues).
Solution:
- HTTP Fallback: Modified
cataloguemate_scraper.pyto use a robust fallback mechanism (Browserless -> Fallback to HTTPX).
3. Catalog Images Fix (Lazy Loading)
Problem: Catalog pages displayed generic icons or placeholders instead of the actual catalog images.
Analysis: The website uses lazy loading. Structure: <img src="loader.svg" data-src="REAL_IMAGE_URL" ... />.
Solution:
- Smart Extraction: Updated
cataloguemate_scraper.pyto checkingdata-srcanddata-originalattributes first. - Improved Filtering: Added
loaderto the ignore list andthumborto the whitelist to ensure only high-quality catalog images are selected.
4. Cleanup
- Removed temporary debug/verification scripts to keep the production environment clean.