isDegradedProductPage - itsManeka/amazing-scraper GitHub Wiki

amazing-scraper


amazing-scraper / isDegradedProductPage

Function: isDegradedProductPage()

isDegradedProductPage(html): boolean

Defined in: src/infrastructure/parsers/isDegradedProductPage.ts:21

Detects if an Amazon product page HTML is degraded (missing critical data).

A page is considered degraded when BOTH conditions are true (AND logic):

  1. Product title (#productTitle) is missing or empty
  2. ALL price selectors are absent from the page

Note: The <title> tag is NOT checked because anti-bot pages (CloudFront blocks) can have a filled <title> with the actual product name but are still degraded (missing #productTitle and all price elements). This heuristic avoids false negatives by focusing on structural absence of critical product data.

This still avoids false positives for legitimate out-of-stock pages, which have productTitle + no prices (only one condition met).

Parameters

html

string

The raw HTML string of the product page

Returns

boolean

true if the page shows signs of session degradation, false otherwise

⚠️ **GitHub.com Fallback** ⚠️