jackwener/OpenCLI · error · CommandExecutionError
IMDb search results did not finish loading
Error message
IMDb search results did not finish loading
What it means
The imdb search command throws this CommandExecutionError when either the URL did not land on the /find/ path (waitForImdbPath returned false) or waitForImdbSearchReady did not report the search results ready within 15000 ms. It fires only after the challenge-page check passes, meaning the page loaded but search results never rendered.
Source
Thrown at clis/imdb/search.js:35
{ name: 'limit', type: 'int', default: 20, help: 'Number of results' },
],
columns: ['rank', 'id', 'title', 'year', 'type', 'url'],
func: async (page, args) => {
const query = String(args.query || '').trim();
// Reject empty or whitespace-only queries early
if (!query) {
throw new ArgumentError('Search query cannot be empty');
}
const limit = Math.max(1, Math.min(Number(args.limit) || 20, 50));
const url = forceEnglishUrl(`https://www.imdb.com/find/?q=${encodeURIComponent(query)}&ref_=nv_sr_sm`);
await page.goto(url);
const onSearchPage = await waitForImdbPath(page, '^/find/?$');
const searchReady = await waitForImdbSearchReady(page, 15000);
if (await isChallengePage(page)) {
throw new CommandExecutionError('IMDb blocked this request', 'Try again with a normal browser session or extension mode');
}
if (!onSearchPage || !searchReady) {
throw new CommandExecutionError('IMDb search results did not finish loading', 'Retry the command; if it persists, the search page structure may have changed');
}
const results = await page.evaluate(`
(function() {
var results = [];
function pushResult(item) {
if (!item || !item.id || !item.title) {
return;
}
results.push(item);
}
var nextDataEl = document.getElementById('__NEXT_DATA__');
if (nextDataEl) {
try {
var nextData = JSON.parse(nextDataEl.textContent || 'null');
var pageProps = nextData && nextData.props && nextData.props.pageProps;
if (pageProps) {View on GitHub (pinned to 49907e53dc)
Solutions
- Retry the command; transient load or slow network is the most common cause.
- Increase patience/timeout options if the library exposes them, or run on a faster connection.
- Check whether IMDb changed the /find/ page structure; the library may need an update.
- Confirm you were not silently redirected (check the final URL) — if so, treat it as blocking/redirect behavior.
Example fix
// before
await imdbSearch({ query: 'duyne' }); // flaky timeout on slow VPN
// after
try {
await imdbSearch({ query: 'duyne' });
} catch (e) {
if (String(e.message).includes('did not finish loading')) await retry(imdbSearch, { query: 'duyne' });
else throw e;
} Defensive patterns
Strategy: retry
Try / catch
try {
return await imdbSearch({ query });
} catch (e) {
if (/did not finish loading/.test(e.message)) {
return retryWithBackoff(() => imdbSearch({ query }), { attempts: 2, baseDelay: 5000 });
}
throw e;
} Prevention
- Retry transient load failures with exponential backoff before surfacing the error.
- Run on a stable, fast network connection; avoid VPN/proxy latency for scraping.
- Pin/keep the library updated in case IMDb changes its search page structure.
- Distinguish blocking (challenge) from slow-load errors to choose the right response.
When it happens
Trigger: After goto of the IMDb find URL: waitForImdbPath(page, '^/find/?$') is false (redirected elsewhere) or waitForImdbSearchReady(page, 15000) times out while isChallengePage is false.
Common situations: Slow network exceeding the 15s timeout, IMDb A/B testing or redesign changing the search page structure, a soft redirect away from /find/, or heavy client-side rendering delaying results.
Related errors
- Douyin search extraction failed: ${error instanceof Error ?
- TimeoutError
- Title page did not finish loading: ${id}
- Indeed job page did not expose detail or error markers withi
- Indeed search page did not expose result or empty-state mark
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/a58cb9914cdff8b0.
Report an issue: GitHub.