jackwener/OpenCLI · error · CommandExecutionError
Title page did not finish loading: ${id}
Error message
Title page did not finish loading: ${id} What it means
The imdb title command throws this CommandExecutionError when waitForImdbPath(page, '^/title/<id>/') returns false, meaning the browser never ended up on the expected title URL path after navigation, even though no challenge page was shown. The library cannot proceed to extract data from a page that is not the requested title page.
Source
Thrown at clis/imdb/title.js:28
access: 'read',
description: 'Get movie or TV show details',
domain: 'www.imdb.com',
strategy: Strategy.PUBLIC,
browser: true,
args: [
{ name: 'id', positional: true, required: true, help: 'IMDb title ID (tt1375666) or URL' },
],
columns: ['field', 'value'],
func: async (page, args) => {
const id = normalizeImdbId(String(args.id), 'tt');
const url = forceEnglishUrl(`https://www.imdb.com/title/${id}/`);
await page.goto(url);
const onTitlePage = await waitForImdbPath(page, `^/title/${id}/`);
if (await isChallengePage(page)) {
throw new CommandExecutionError('IMDb blocked this request', 'Try again with a normal browser session or extension mode');
}
if (!onTitlePage) {
throw new CommandExecutionError(`Title page did not finish loading: ${id}`, 'Retry the command; if it persists, IMDb may have changed their navigation flow');
}
const currentId = await getCurrentImdbId(page, 'tt');
if (currentId && currentId !== id) {
throw new CommandExecutionError(`IMDb redirected to a different title: ${currentId}`, 'Retry the command; if it persists, the title page may have changed');
}
// Single browser roundtrip: fetch title JSON-LD by type whitelist
const titleTypes = ['Movie', 'TVSeries', 'TVEpisode', 'TVMiniseries', 'TVMovie', 'TVSpecial', 'VideoGame', 'ShortFilm'];
const ld = await extractJsonLd(page, titleTypes);
if (!ld) {
throw new CommandExecutionError(`Title not found: ${id}`, 'Check the title ID and try again');
}
const data = ld;
const type = String(data['@type'] || '');
const isTvSeries = type === 'TVSeries' || type === 'TVMiniseries';
// Handle both array and single-object JSON-LD person fields
const toPeople = (arr) => {
if (!arr)
return '';View on GitHub (pinned to 49907e53dc)
Solutions
- Retry the command; transient navigation timing is the most common cause.
- Verify the title ID is a valid, currently-resolvable tt ID.
- Check whether IMDb changed its title URL structure; the library may need an update.
- Ensure no consent/region interstitial is intercepting navigation (try the extension/normal browser mode).
Example fix
// before
await imdbTitle({ id: 'tt9999999' }); // dead id, page never lands
// after
const id = 'tt0111161'; // verified resolvable id
await imdbTitle({ id }); Defensive patterns
Strategy: retry
Validate before calling
if (!/^tt\d{7,8}$/.test(id)) throw new Error(`invalid IMDb title id: ${id}`); Type guard
function isValidTitleId(id) {
return typeof id === 'string' && /^tt\d{7,8}$/.test(id);
} Try / catch
try {
return await imdbTitle({ id });
} catch (e) {
if (new RegExp(`Title page did not finish loading: ${id}`).test(e.message)) {
return retryWithBackoff(() => imdbTitle({ id }), { attempts: 2 });
}
throw e;
} Prevention
- Validate title IDs against /^tt\d{7,8}$/ before calling.
- Retry once or twice on transient navigation failures.
- Keep the library updated for IMDb URL/routing changes.
- Watch for silent redirects to consent/region pages when using proxies.
When it happens
Trigger: After page.goto of https://www.imdb.com/title/<id>/ and passing the isChallengePage check, waitForImdbPath for `^/title/${id}/` resolves false — e.g. the URL redirected or the SPA never settled on the expected path.
Common situations: IMDb redesign changing URL patterns, SPA routing delays, being softly redirected to a regional/consent page, or a malformed ID passing normalization but not resolving.
Related errors
- IMDb search results did not finish loading
- Indeed job page did not expose detail or error markers withi
- Indeed search page did not expose result or empty-state mark
- coupang add-to-cart navigation failed: ${error?.message || e
- Ctrip place page did not render attraction links for city id
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/2318586b6eeeaa3d.
Report an issue: GitHub.