jackwener/OpenCLI · error · CommandExecutionError

amazon product page did not expose product content (landed o

Error message

amazon product page did not expose product content (landed on ${landedUrl})

What it means

CommandExecutionError thrown by the amazon product command when the fetched page has no product_title, meaning the product content surface was not readable. The message includes the URL actually landed on, helping distinguish redirects, robot checks, and invalid ASINs. The library prefers failing loudly over returning empty product rows.

Source

Thrown at clis/amazon/product.js:87

    description: 'Amazon product page facts for candidate validation',
    domain: 'amazon.com',
    strategy: Strategy.COOKIE,
    navigateBefore: false,
    args: [
        {
            name: 'input',
            required: true,
            positional: true,
            help: 'ASIN or product URL, for example B0FJS72893',
        },
    ],
    columns: ['asin', 'title', 'price_text', 'rating_value', 'review_count'],
    func: async (page, kwargs) => {
        const input = String(kwargs.input ?? '');
        const payload = await readProductPayload(page, input);
        if (!cleanText(payload.product_title)) {
            const landedUrl = cleanText(payload.href) || buildProductUrl(input);
            throw new CommandExecutionError(`amazon product page did not expose product content (landed on ${landedUrl})`, 'The product page may have changed or hit a robot check. Open the product page in Chrome and retry.');
        }
        return [normalizeProductPayload(payload)];
    },
});
export const __test__ = {
    normalizeProductPayload,
};

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the ASIN/URL is valid by opening the landed URL (in the message) in Chrome — if it 404s, fix the input
  2. Complete any captcha shown in Chrome, then retry
  3. Retry with backoff / slower cadence if robot checks are triggered by scraping rate
  4. If the page renders manually with a title, the #productTitle selector likely needs updating for a new layout

Example fix

// before
await opencli.call('amazon product', { input: 'B0FJS7289' }); // wrong ASIN length
// throws CommandExecutionError('amazon product page did not expose product content ...')

// after
const asin = 'B0FJS72893'; // validate 10-char ASIN before calling
if (/^B0[A-Z0-9]{8}$/.test(asin)) {
  await opencli.call('amazon product', { input: asin });
}
Defensive patterns

Strategy: validation

Validate before calling

function isValidAsin(s) { return /^[A-Z0-9]{10}$/.test(String(s).trim().toUpperCase()); }
if (!isValidAsin(input)) throw new Error('invalid ASIN: ' + input);

Type guard

function isValidAsin(v) {
  return typeof v === 'string' && /^[A-Z0-9]{10}$/.test(v.trim().toUpperCase());
}

Try / catch

try {
  return await opencli.call('amazon product', { input: asin });
} catch (e) {
  if (/did not expose product content/.test(e.message)) {
    const landed = e.message.match(/landed on (.+?)\)/)?.[1];
    // inspect landed URL: 404 -> bad ASIN; captcha -> retry later
    throw new Error('product scrape failed, landed on ' + landed);
  }
  throw e;
}

Prevention

When it happens

Trigger: Running amazon product with an ASIN/URL where readProductPayload returns a payload whose product_title is empty/whitespace after cleanText — e.g. the navigation landed on a robot-check page, a 404/'Sorry, we couldn't find that page' page, or a layout without the title element. The landed URL in the message comes from payload.href or buildProductUrl(input).

Common situations: Invalid or mistyped ASIN producing a 404; Amazon captcha/robot interstitial under rapid scraping; product removed or region-locked; Amazon markup change removing the #productTitle selector; redirect to the Amazon home page.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/6d86f4b8464a29e8. Report an issue: GitHub.