fix: FS.COM price extraction — use .no_tax/.price CSS selectors
FS.com changed their HTML structure; compound class names are gone. Current layout (verified 2026-05-06): <div class="no_tax">5,10 € ohne MwSt.</div> ← B2B net price (preferred) <div class="price">6,07 €</div> ← gross fallback <div class="standard_price">6,07 €</div> ← gross fallback Old selectors ([class*='price-value'] etc.) matched nothing → all prices stored as €? null. New .no_tax first gives us the correct net/B2B price.
This commit is contained in:
parent
a1a525b332
commit
1a7c928120
@ -440,8 +440,19 @@ async function scrapeProductDetails(
|
|||||||
// FS.com shows "Gratis Versand ab 79 € (ohne MwSt.)" on every page.
|
// FS.com shows "Gratis Versand ab 79 € (ohne MwSt.)" on every page.
|
||||||
// bodyText regex matches this and returns 79 for ALL products. We extract
|
// bodyText regex matches this and returns 79 for ALL products. We extract
|
||||||
// the actual product price from its own DOM element, skipping bad parents.
|
// the actual product price from its own DOM element, skipping bad parents.
|
||||||
|
// ── Net price (ohne MwSt) preferred for B2B comparisons ──────────────
|
||||||
|
// FS.com HTML structure (verified 2026-05-06):
|
||||||
|
// <div class="no_tax">5,10 € ohne MwSt.</div> ← net price ✓
|
||||||
|
// <div class="price">6,07 €</div> ← gross price
|
||||||
|
// <div class="standard_price">6,07 €</div> ← gross
|
||||||
|
// The .no_tax element contains the B2B net price — prefer it.
|
||||||
let priceRaw = "";
|
let priceRaw = "";
|
||||||
const PRICE_SELS = [
|
const PRICE_SELS = [
|
||||||
|
// ── FS.com current structure (2026-05) — net price first ──
|
||||||
|
".no_tax", // "5,10 € ohne MwSt." — net/B2B price
|
||||||
|
".standard_price", // "6,07 €" — gross fallback
|
||||||
|
".price", // "6,07 €" — gross fallback (simple class)
|
||||||
|
// ── Legacy / other patterns ───────────────────────────────
|
||||||
"[class*='price-value']",
|
"[class*='price-value']",
|
||||||
"[class*='product-price']",
|
"[class*='product-price']",
|
||||||
"[class*='prod-price']",
|
"[class*='prod-price']",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user