fix(bikegear): use brand name from BRANDS list instead of JSON-LD brand field
JSON-LD on bikegear.in has incorrect/all-caps brand names (e.g. "ACERBIS Hemets", full page titles as brand). Our BRANDS list has the correct clean names. Changed priority: brandName (our list) > jsonLd.brand.name > fallback. Applied to both standalone local scraper and server scraper. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6ba4dc7d83
commit
d287801551
@ -353,7 +353,7 @@ async function scrapeProductDetail(productUrl, brandName) {
|
|||||||
url: productUrl,
|
url: productUrl,
|
||||||
sku: jsonLd.sku || productUrl.split("/").pop(),
|
sku: jsonLd.sku || productUrl.split("/").pop(),
|
||||||
name: jsonLd.name || "",
|
name: jsonLd.name || "",
|
||||||
brand: jsonLd.brand?.name || brandName,
|
brand: brandName || jsonLd.brand?.name || "BikeGear",
|
||||||
price,
|
price,
|
||||||
currency: jsonLd.offers?.priceCurrency || "INR",
|
currency: jsonLd.offers?.priceCurrency || "INR",
|
||||||
availability: jsonLd.offers?.availability?.replace("https://schema.org/", "") || "Unknown",
|
availability: jsonLd.offers?.availability?.replace("https://schema.org/", "") || "Unknown",
|
||||||
|
|||||||
@ -561,7 +561,7 @@ async function scrapeProductDetail(productUrl, brandName, refererUrl = null) {
|
|||||||
url: productUrl,
|
url: productUrl,
|
||||||
sku: jsonLd.sku || productUrl.split("/").pop(),
|
sku: jsonLd.sku || productUrl.split("/").pop(),
|
||||||
name: jsonLd.name || "",
|
name: jsonLd.name || "",
|
||||||
brand: jsonLd.brand?.name || brandName,
|
brand: brandName || jsonLd.brand?.name || "BikeGear",
|
||||||
price,
|
price,
|
||||||
currency,
|
currency,
|
||||||
availability: jsonLd.offers?.availability?.replace("https://schema.org/", "") || "Unknown",
|
availability: jsonLd.offers?.availability?.replace("https://schema.org/", "") || "Unknown",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user