Files
Priceflow/app
Claude 4c98fee285 fix: Skip strikethrough prices to avoid detecting old/crossed-out prices
**Problem:**
AI was detecting old crossed-out prices instead of current prices.
Example: Stokomani Lutin - Current: 19,99€, Old (strikethrough): 14,99€
AI detected: 14.99 EUR (wrong - old price)

**Root Cause:**
Generic price extraction was finding ALL price elements without checking
if they were visually crossed-out (text-decoration: line-through).
Many e-commerce sites show:
```html
<span class="old-price" style="text-decoration: line-through">14,99 €</span>
<span class="price">19,99 €</span>
```
The selector finds both, but we were returning the first found.

**Solution: Check CSS text-decoration**

Added strikethrough detection (browserless_service.py:182-189):
```python
# Check if element is strikethrough (old price)
text_decoration = await element.evaluate(
    "el => window.getComputedStyle(el).textDecoration"
)
if "line-through" in text_decoration:
    continue  # Skip crossed-out prices
```

**Flow:**
```
Found elements with .price selector: [elem1, elem2, elem3]
  ↓
For each element:
  1. Check visibility ✓
  2. Check text-decoration
     → "line-through" → SKIP ✓
     → "none" → CONTINUE
  3. Extract price text
  ↓
Return first non-strikethrough price
```

**CSS Patterns Detected:**
- `text-decoration: line-through` (most common)
- `text-decoration: line-through solid`
- Combined styles ignored if they don't contain "line-through"

**Expected Results:**
- Before: Returns first price found (14.99 if it's first in DOM)
- After: Skips strikethrough prices, returns current price (19.99)

**Note:** Existing selector already excludes common classes:
`:not([class*='old']):not([class*='was']):not([class*='original'])`

This adds runtime CSS check as additional safety layer.

Partial fix for Stokomani Lutin 14.99 vs 19.99 issue.
May need site-specific selectors if problem persists.
2025-11-29 23:52:10 +00:00
..
2025-11-22 10:01:25 +01:00
2025-11-22 10:01:25 +01:00
2025-11-22 10:01:25 +01:00
2025-11-22 10:01:25 +01:00