jackwener/OpenCLI · error · CommandExecutionError
amazon ${action} hit a robot check
Error message
amazon ${action} hit a robot check What it means
A CommandExecutionError thrown by assertUsableState when the loaded Amazon page state matches the robot-check pattern (isRobotState). Amazon served a CAPTCHA/verify page instead of real content, so the library aborts with a challenge hint rather than returning garbage or empty data. It is detected in every read path: search, product, discussion, offers, and rankings.
Source
Thrown at clis/amazon/shared.js:395
try {
await page.goto(url, { settleMs });
await page.wait(1.5);
return await readPageState(page);
}
catch (error) {
const message = error instanceof Error ? error.message : String(error);
if (message.includes('Inspected target navigated or closed')
|| message.includes('Cannot find context with specified id')
|| message.includes('Target closed')) {
throw new CommandExecutionError(`amazon ${action} navigation lost the current browser target`, `${buildChallengeHint(action)} If CDP is attached to a stale tab, open a fresh Amazon tab and retry.`);
}
throw error;
}
}
export function assertUsableState(state, action) {
if (!isRobotState(state))
return;
throw new CommandExecutionError(`amazon ${action} hit a robot check`, buildChallengeHint(action));
}
export const __test__ = {
buildSearchUrl,
extractAsin,
amazonHostFromInput,
buildProductUrl,
buildDiscussionUrl,
normalizeProductUrl,
canonicalizeAmazonUrl,
resolveBestsellersUrl,
resolveRankingUrl,
isSupportedRankingPath,
isRankingPaginationUrl,
extractCategoryNodeId,
parsePriceText,
parseRatingValue,
parseReviewCount,
extractReviewCountFromCardText,View on GitHub (pinned to 49907e53dc)
Solutions
- Solve the robot check manually in the attached Chrome tab, then retry
- Switch to a residential IP or different network/proxy
- Slow down request rate and add delays between commands
- Reuse a logged-in browser session with real cookies instead of a clean headless profile
Example fix
// before
for (const asin of asins) await amazonProduct(asin); // rapid-fire
// after
for (const asin of asins) {
await amazonProduct(asin);
await new Promise((r) => setTimeout(r, 5000));
} Defensive patterns
Strategy: retry
Validate before calling
// pre-check the page before parsing:
const html = await page.content();
if (/captcha|Enter the characters you see below/i.test(html)) throw new Error('robot check present — solve it manually first'); Try / catch
try {
const data = await amazonSearch({ query });
} catch (err) {
if (err.message.includes('hit a robot check')) {
await sleep(30000); // back off
// or pause and let a human solve the CAPTCHA in the attached tab
return amazonSearch({ query });
} else throw err;
} Prevention
- Run from residential IPs, not datacenter/CI
- Throttle request rate with delays between commands
- Reuse a logged-in session with real cookies
- Solve any CAPTCHA in the attached Chrome tab promptly
- Rotate proxies if volume is high
When it happens
Trigger: Any amazon read command (search/product/discussion/offer/rankings) where the rendered page contains Amazon's bot-detection interstitial — typically triggered by datacenter IPs, high request rates, missing cookies, or headless browser fingerprints.
Common situations: Running automation from AWS/GitHub Actions/CI IPs; scraping too many pages per minute; reusing a session that already tripped a challenge; headless Chrome fingerprint detection; regional blocks.
Related errors
- Xianyu inbox is blocked by verification or risk control
- amazon discussion page did not expose review summary (landed
- amazon product page did not expose product content (landed o
- amazon ${definition.commandName} did not expose any ranked i
- amazon search did not expose any product cards
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/68a20c339d0e0ca1.
Report an issue: GitHub.