jackwener/OpenCLI · warning · EmptyResultError

No hotels rendered (${totalText}). Try a broader destination

Error message

No hotels rendered (${totalText}). Try a broader destination, different dates, or check the URL in a browser.

What it means

This EmptyResultError is thrown when the extractor parsed zero property cards AND the page's result-count text shows no positive result count (or is empty). It is the library's way of saying 'the search legitimately returned nothing to show', wrapping the totalText as detail plus advice to broaden the query. Unlike error 527, this is not a parsing failure — the page itself had no hotel cards.

Source

Thrown at clis/booking/search.js:302

      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}`,
        );
      }
      throw new EmptyResultError(
        `booking search ${JSON.stringify(destination)}`,
        totalText
          ? `No hotels rendered (${totalText}). Try a broader destination, different dates, or check the URL in a browser.`
          : 'No hotels rendered. Try a broader destination, different dates, or check the URL in a browser.',
      );
    }

    return items.slice(0, limit).map((it, i) => {
      if (!it || typeof it !== 'object') {
        throw new CommandExecutionError('Booking.com extractor returned malformed hotel row');
      }
      const name = String(it.name || '').trim();
      const country = String(it.country || '').trim();
      const slug = String(it.slug || '').trim();
      const urlValue = String(it.url || '').trim();
      const expectedUrl = country && slug
        ? `https://www.booking.com/hotel/${country}/${slug}.html`
        : '';

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Broaden the destination (city/region instead of a specific address or landmark).
  2. Try different or nearer-term checkin/checkout dates.
  3. Open the generated URL in a browser to verify the query itself yields results.
  4. Check spelling and use a well-known place name for the destination.
  5. Relax any additional filters and retry with default currency/language parameters.

Example fix

// before
await search({ destination: 'Rue de la PAix 12, Paris', checkin: '2026-05-10', checkout: '2026-05-11' });
// after
await search({ destination: 'Paris', checkin: '2026-05-10', checkout: '2026-05-11' });
Defensive patterns

Strategy: fallback

Validate before calling

function looksLikeRealPlace(dest) {
  const d = String(dest || '').trim();
  return d.length >= 3 && !/^\d+$/.test(d); // crude sanity check on destination
}
if (!looksLikeRealPlace(destination)) console.warn('destination may yield zero results; consider broadening');

Try / catch

try {
  return await booking.search(params);
} catch (e) {
  if (e instanceof EmptyResultError || /No hotels rendered/.test(e.message)) {
    return booking.search({ ...params, destination: broadenDestination(params.destination) });
  }
  throw e;
}

Prevention

When it happens

Trigger: items.length === 0 and hasPositiveResultCount(totalText) is false — e.g. totalText is '0 properties found' or empty because Booking.com rendered no results for the query.

Common situations: Very narrow/misspelled destination; dates far in the future or in the past; filters implicit in the URL excluding everything; tiny villages with no listed properties; currency/lang parameters producing a locale with no inventory.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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