diff --git a/packages/scraper/src/scrapers/flexoptix-catalog.ts b/packages/scraper/src/scrapers/flexoptix-catalog.ts index 0900d3f..68336d5 100644 --- a/packages/scraper/src/scrapers/flexoptix-catalog.ts +++ b/packages/scraper/src/scrapers/flexoptix-catalog.ts @@ -397,6 +397,10 @@ export async function scrapeFlexoptixCatalog(): Promise { const GRAPHQL_URL = `${BASE}/graphql`; const GRAPHQL_QUERIES = [ + { search: "1G SFP", defaultFF: "SFP", defaultGbps: 1 }, + { search: "SFP LX", defaultFF: "SFP", defaultGbps: 1 }, + { search: "SFP SX", defaultFF: "SFP", defaultGbps: 1 }, + { search: "SFP ZX", defaultFF: "SFP", defaultGbps: 1 }, { search: "SFP+", defaultFF: "SFP+", defaultGbps: 10 }, { search: "SFP28", defaultFF: "SFP28", defaultGbps: 25 }, { search: "QSFP+", defaultFF: "QSFP+", defaultGbps: 40 }, @@ -494,9 +498,13 @@ export async function scrapeFlexoptixCatalog(): Promise { const rawImg = item.small_image?.url; const imageUrl = rawImg && !rawImg.includes("placeholder") ? rawImg : undefined; + // Strip the vendor-compatibility suffix (e.g. ":Sx", ":Ci", ":Ju") from SKU + // The base SKU (before ":") is the canonical FLEXOPTIX part number + const baseSku = item.sku.includes(":") ? item.sku.split(":")[0] : item.sku; + allProducts.set(url, { name: item.name, - partNumber: item.sku, + partNumber: baseSku, url, price: price && price > 0 && price < 100000 ? price : undefined, currency: item.price_range?.minimum_price?.final_price?.currency || "EUR", @@ -515,8 +523,8 @@ export async function scrapeFlexoptixCatalog(): Promise { totalFetched += products.items.length; if (newCount > 0) console.log(` GraphQL "${gq.search}" p${page}: +${newCount} new (${products.items.length} items, ${products.total_count} total)`); - // Stop if we've fetched all pages or reached a reasonable limit - if (totalFetched >= products.total_count || totalFetched >= 200 || page >= 10) break; + // Stop if we've fetched all pages (no artificial cap — let the API determine the limit) + if (totalFetched >= products.total_count || page >= 50) break; page++; await sleep(800); } catch (err) {