{"record":{"id":"2d94a47d995a2c47","repo":"jackwener/OpenCLI","slug":"trip-com-is-asking-for-a-verification-complete-it-2d94a4","errorCode":null,"errorMessage":"Trip.com is asking for a verification; complete it in your browser session and retry","messagePattern":"Trip\\.com is asking for a verification; complete it in your browser session and retry","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"warning","filePath":"clis/trip/car.js","lineNumber":49,"sourceCode":"        { name: 'city', required: true, positional: true, help: 'Numeric Trip.com carhire city id (discover via the carhire search box)' },\n        { name: 'limit', type: 'int', default: 20, help: 'Number of vehicles (1-50)' },\n    ],\n    columns: [\n        'rank',\n        'category', 'vehicle',\n        'seats',\n        'price', 'currency',\n        'url',\n    ],\n    func: async (page, kwargs) => {\n        const cityId = parseCityId('city', kwargs.city);\n        const limit = parseListLimit(kwargs.limit);\n\n        const listUrl = buildCarListUrl(cityId);\n        await page.goto(listUrl);\n        const waitResult = await page.evaluate(WAIT_FOR_CARS_JS);\n        if (waitResult === 'captcha') {\n            throw new AuthRequiredError('trip.com', 'Trip.com is asking for a verification; complete it in your browser session and retry');\n        }\n        if (waitResult === 'empty') {\n            throw new EmptyResultError('trip car', `No car rentals for city id ${cityId}`);\n        }\n        if (waitResult !== 'content') {\n            throw new CommandExecutionError(`Trip.com car listing did not render (state=${String(waitResult)}); check the carhire city id`);\n        }\n        const raw = await page.evaluate(buildCarExtractJs());\n        if (!Array.isArray(raw)) {\n            throw new CommandExecutionError('Trip.com car DOM extraction returned malformed rows');\n        }\n        if (raw.length === 0) {\n            throw new CommandExecutionError('Trip.com car cards rendered but parser did not find required price anchors');\n        }\n        return raw.slice(0, limit).map((r, i) => ({\n            rank: i + 1,\n            category: r.category,\n            vehicle: r.vehicle,","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trip/car.js#L31-L67","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before: retrying immediately on failure\nawait runCli(['trip', 'car', '--city-id', cityId]);\n// after: handle captcha explicitly\ntry {\n  await runCli(['trip', 'car', '--city-id', cityId]);\n} catch (e) {\n  if (e.name === 'AuthRequiredError') {\n    await promptManualBrowserVerification('trip.com');\n    return runCli(['trip', 'car', '--city-id', cityId]);\n  }\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  return await runCli(['trip', 'car', '--city-id', cityId]);\n} catch (e) {\n  if (e.name === 'AuthRequiredError') {\n    // needs human: complete Trip.com check in the shared browser session\n    await promptManualVerification(e.message);\n    return runCli(['trip', 'car', '--city-id', cityId]); // single retry only\n  }\n  throw e;\n}","preventionTips":["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."],"tags":["captcha","anti-bot","auth-required","scraping","trip-com"],"backgroundTag":"captcha-challenge-required","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}