isDegradedProductPage - itsManeka/amazing-scraper GitHub Wiki
amazing-scraper / 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):
- Product title (#productTitle) is missing or empty
- 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).
string
The raw HTML string of the product page
boolean
true if the page shows signs of session degradation, false otherwise