jackwener/OpenCLI · warning · AuthRequiredError
Trip.com is asking for a verification; complete it in your b
Error message
Trip.com is asking for a verification; complete it in your browser session and retry
What it means
The `trip car` command loads Trip.com's carhire listing page for a given city id in a cookie-backed browser session. When the in-page wait script (WAIT_FOR_CARS_JS) reports state 'captcha' — Trip.com served a bot-verification challenge instead of the car listing — the command throws AuthRequiredError directing the user to complete the verification in their browser session and retry. It is an intentional stop until a human passes the check.
Source
Thrown at clis/trip/car.js:49
{ name: 'city', required: true, positional: true, help: 'Numeric Trip.com carhire city id (discover via the carhire search box)' },
{ name: 'limit', type: 'int', default: 20, help: 'Number of vehicles (1-50)' },
],
columns: [
'rank',
'category', 'vehicle',
'seats',
'price', 'currency',
'url',
],
func: async (page, kwargs) => {
const cityId = parseCityId('city', kwargs.city);
const limit = parseListLimit(kwargs.limit);
const listUrl = buildCarListUrl(cityId);
await page.goto(listUrl);
const waitResult = await page.evaluate(WAIT_FOR_CARS_JS);
if (waitResult === 'captcha') {
throw new AuthRequiredError('trip.com', 'Trip.com is asking for a verification; complete it in your browser session and retry');
}
if (waitResult === 'empty') {
throw new EmptyResultError('trip car', `No car rentals for city id ${cityId}`);
}
if (waitResult !== 'content') {
throw new CommandExecutionError(`Trip.com car listing did not render (state=${String(waitResult)}); check the carhire city id`);
}
const raw = await page.evaluate(buildCarExtractJs());
if (!Array.isArray(raw)) {
throw new CommandExecutionError('Trip.com car DOM extraction returned malformed rows');
}
if (raw.length === 0) {
throw new CommandExecutionError('Trip.com car cards rendered but parser did not find required price anchors');
}
return raw.slice(0, limit).map((r, i) => ({
rank: i + 1,
category: r.category,
vehicle: r.vehicle,View on GitHub (pinned to 49907e53dc)
Solutions
- Open the same browser profile interactively, complete the Trip.com verification, then rerun the command.
- Refresh stored Trip.com cookies by logging in again interactively (Strategy.COOKIE relies on them).
- Slow down automated request rate and add delays between car searches.
- Switch off VPN/datacenter proxy and use a residential IP to reduce challenge frequency.
Example fix
// before: retrying immediately on failure
await runCli(['trip', 'car', '--city-id', cityId]);
// after: handle captcha explicitly
try {
await runCli(['trip', 'car', '--city-id', cityId]);
} catch (e) {
if (e.name === 'AuthRequiredError') {
await promptManualBrowserVerification('trip.com');
return runCli(['trip', 'car', '--city-id', cityId]);
}
throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
null
Type guard
null
Try / catch
try {
return await runCli(['trip', 'car', '--city-id', cityId]);
} catch (e) {
if (e.name === 'AuthRequiredError') {
// needs human: complete Trip.com check in the shared browser session
await promptManualVerification(e.message);
return runCli(['trip', 'car', '--city-id', cityId]); // single retry only
}
throw e;
} Prevention
- Refresh Trip.com cookies before long automated car-search batches.
- Space out carhire queries to avoid triggering bot challenges.
- Use residential IPs; datacenter ranges are frequently challenged.
- Do not loop-retry AuthRequiredError — always solve the verification first.
When it happens
Trigger: Calling the trip car CLI when page.evaluate(WAIT_FOR_CARS_JS) resolves to 'captcha' after page.goto on buildCarListUrl(cityId) — Trip.com responded to the carhire URL with an anti-bot challenge.
Common situations: Stale/expired Trip.com cookies in the shared browser profile; rapid successive car-listing queries triggering rate limiting; datacenter or VPN IP flagged by Trip.com's bot detection; headless browser fingerprint detection.
Related errors
- Trip.com is asking for a verification; complete it in your b
- Trip.com is asking for a verification; complete it in your b
- Ctrip is asking for a captcha; complete it in your browser s
- Ctrip is asking for a captcha; complete it in your browser s
- Trip.com is asking for a verification; complete it in your b
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/2d94a47d995a2c47.
Report an issue: GitHub.