From dfe86fb347043c91a07c1d09efe2a92169e61d83 Mon Sep 17 00:00:00 2001 From: Rene Fichtmueller Date: Mon, 6 Apr 2026 01:24:47 +0200 Subject: [PATCH] fix(scraper): switch fs-com to de.fs.com for EUR prices as primary source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EUR prices scraped verbatim from de.fs.com — no conversion needed. USD derivation (EUR→USD) happens downstream, not EUR←USD. Fixes price discrepancy: TIP showed USD 999×0.92=EUR 866 vs real €948 on de.fs.com. --- packages/scraper/src/scrapers/fs-com.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/scraper/src/scrapers/fs-com.ts b/packages/scraper/src/scrapers/fs-com.ts index c503811..9f48088 100644 --- a/packages/scraper/src/scrapers/fs-com.ts +++ b/packages/scraper/src/scrapers/fs-com.ts @@ -11,7 +11,9 @@ import { ensureVendor, upsertPriceObservation, findOrCreateScrapedTransceiver, p import { contentHash, parsePrice, parseStockLevel, parseQuantity } from "../utils/hash"; import { updateVerifiedSpecs, parseSpecTable } from "../utils/spec-updater"; -const BASE_URL = "https://www.fs.com"; +// Use German store (de.fs.com) — scrapes EUR prices directly from the website. +// EUR is the primary price; USD is derived (EUR → USD), never the reverse. +const BASE_URL = "https://de.fs.com"; const CATEGORY_URLS = [ "/c/1g-sfp-81", @@ -104,19 +106,20 @@ export async function scrapeFs(): Promise { headless: true, launchContext: { launchOptions: { - args: ["--disable-blink-features=AutomationControlled", "--lang=en-US"], + args: ["--disable-blink-features=AutomationControlled", "--lang=de-DE"], }, }, preNavigationHooks: [ async ({ page }) => { await page.setExtraHTTPHeaders({ - "Accept-Language": "en-US,en;q=0.9", + "Accept-Language": "de-DE,de;q=0.9", }); + // EUR as primary currency — prices scraped verbatim from de.fs.com await page.context().addCookies([ - { name: "currency", value: "USD", domain: ".fs.com", path: "/" }, - { name: "lang", value: "en", domain: ".fs.com", path: "/" }, - { name: "country", value: "US", domain: ".fs.com", path: "/" }, + { name: "currency", value: "EUR", domain: ".fs.com", path: "/" }, + { name: "lang", value: "de", domain: ".fs.com", path: "/" }, + { name: "country", value: "DE", domain: ".fs.com", path: "/" }, ]); }, ],