jackwener/OpenCLI · error · CommandExecutionError
Booking.com page returned no extractable data
Error message
Booking.com page returned no extractable data
What it means
This CommandExecutionError is thrown when page.evaluate(EXTRACTOR) returned a value that is not a usable object (null, undefined, or a non-object). It means the extractor ran but produced nothing the command can process. It is a distinct failure from extraction throwing: the script completed but its result was empty or of the wrong shape.
Source
Thrown at clis/booking/search.js:281
// Booking lazy-loads price cells; wait for at least the first card price to settle.
try {
await page.wait('selector', '[data-testid=property-card]', { timeoutMs: 20000 });
} catch (_) {
// selector wait is best-effort — extractor handles empty case explicitly
}
let raw;
try {
raw = await page.evaluate(EXTRACTOR);
} catch (err) {
throw new CommandExecutionError(`Failed to extract Booking.com cards: ${err?.message || err}`);
}
if (raw && typeof raw === 'object' && raw.data && raw.session) {
raw = raw.data;
}
if (!raw || typeof raw !== 'object') {
throw new CommandExecutionError('Booking.com page returned no extractable data');
}
if (raw.blocked) {
throw new CommandExecutionError('Booking.com served a verification / captcha page; retry later or change profile');
}
if (raw.ok !== true) {
throw new CommandExecutionError('Booking.com extractor returned an invalid status');
}
if (!Array.isArray(raw.items)) {
throw new CommandExecutionError('Booking.com extractor returned malformed items');
}
const items = raw.items;
if (items.length === 0) {
const totalText = String(raw.totalText || '').trim();
if (hasPositiveResultCount(totalText)) {
throw new CommandExecutionError(
`Booking.com page declared results but no property cards were parsed: ${totalText}`,View on GitHub (pinned to 49907e53dc)
Solutions
- Retry with a different destination/dates or later — the page may have rendered no content.
- Load the search URL in a normal browser to confirm results actually render.
- Change browser profile / user agent if the site is serving bot-detection shells.
- Update the library if Booking.com changed its page structure.
- Add logging of the raw return value to see exactly what the extractor produced.
Example fix
// before
const raw = await page.evaluate(EXTRACTOR);
if (!raw || typeof raw !== 'object') throw new Error('no data');
// after
const raw = await page.evaluate(EXTRACTOR);
console.error('extractor returned:', raw); // diagnose before failing
if (!raw || typeof raw !== 'object') throw new Error('no data'); Defensive patterns
Strategy: fallback
Validate before calling
// validate inputs are likely to produce a rendered results page
if (!destination || String(destination).trim().length < 2) throw new Error('destination too short to yield results'); Try / catch
try {
return await booking.search(params);
} catch (e) {
if (/no extractable data/.test(e.message)) {
return fallbackSearchProvider(params); // alternate scraper or API
}
throw e;
} Prevention
- Retry once before giving up — shell pages are often transient.
- Use a realistic browser profile/user agent to avoid bot-shell responses.
- Confirm the URL renders in a normal browser when debugging.
- Keep the library updated for Booking.com structural changes.
- Have a secondary data source configured for critical workflows.
When it happens
Trigger: The extractor returned null/undefined or a primitive — e.g. the selector found no nodes and the extractor short-circuited, or an enveloped result {data, session} unwrapped to nothing.
Common situations: Booking.com served an empty or skeleton shell page (no results markup) so the extractor bailed; a soft bot-block page with HTTP 200 returned no data; an intermediate/redirect page was captured instead of results; extractor version mismatch after a site update.
Related errors
- Working tree not clean: ${status}
- Failed to fetch Barchart greeks for ${symbol}
- Failed to extract Booking.com cards: ${err?.message || err}
- Booking.com extractor returned an invalid status
- Booking.com extractor returned malformed items
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/a74dff42c70fc239.
Report an issue: GitHub.