jackwener/OpenCLI · error · EmptyResultError
Tieba may have blocked the thread page, or the DOM structure
Error message
Tieba may have blocked the thread page, or the DOM structure may have changed
What it means
After `tieba read` asserts it is on the correct thread page, it extracts posts/comments via `buildTiebaReadItems`. If the extraction yields zero items while the page URL was correct, the library throws this EmptyResultError rather than returning an empty array, because a rendered Tieba thread page should always contain at least the main post. This signals either a block/challenge page or a DOM structure change that broke the selectors.
Source
Thrown at clis/tieba/read.js:137
navigateBefore: false,
args: [
{ name: 'id', positional: true, required: true, type: 'string', help: 'Thread ID' },
{ name: 'page', type: 'int', default: 1, help: 'Page number' },
{ name: 'limit', type: 'int', default: 30, help: 'Number of replies to return' },
],
columns: ['floor', 'author', 'content', 'time'],
func: async (page, kwargs) => {
const pageNumber = Math.max(1, Number(kwargs.page || 1));
// Use the browser's normal settle path so we do not scrape stale DOM from the previous tab state.
await page.goto(getThreadUrl(kwargs));
const raw = (await page.evaluate(buildExtractReadEvaluate()) || {});
assertTiebaReadTargetPage(raw, kwargs);
const items = buildTiebaReadItems(raw, {
limit: kwargs.limit,
includeMainPost: pageNumber === 1,
});
if (!items.length) {
throw new EmptyResultError('tieba read', 'Tieba may have blocked the thread page, or the DOM structure may have changed');
}
return items;
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Re-run with a logged-in, cookie-persisted browser profile — anonymous/headless requests are the most commonly blocked.
- Switch to a residential IP or wait out a temporary Baidu rate-limit block, then retry.
- Open the thread URL manually in the same browser session to confirm whether a captcha/verification page is shown, and complete it.
- If the page renders fine manually, the selectors are outdated — update the library to match the new Tieba DOM.
Defensive patterns
Strategy: retry
Validate before calling
// quick reachability/auth sanity check before scraping
const res = await fetch(`https://tieba.baidu.com/p/${threadId}`, { method: 'HEAD' });
if (res.status === 404) throw new Error('thread does not exist'); Try / catch
try {
return await cli.read({ id: threadId, page });
} catch (e) {
if (e instanceof EmptyResultError) {
await backoff(delay); // likely a block wall
return cli.read({ id: threadId, page }); // retry, ideally logged-in profile
}
throw e;
} Prevention
- Use a cookie-persisted, logged-in profile for scrapes.
- Throttle request rate and rotate residential IPs to avoid Baidu soft blocks.
- Verify selectors against live pages after Tieba frontend updates.
- Surface the error to users as 'blocked or DOM changed' instead of silent empty results.
When it happens
Trigger: Calling `tieba read` (single fetch or streaming run in the cli() handler) when the page content has no extractable thread items: Tieba served an anti-bot/verification wall at the correct URL, the thread content is behind a login, or Tieba changed its markup so the extraction script finds no posts.
Common situations: Datacenter IP flagged by Baidu leading to a soft-block with the URL unchanged; headless browser fingerprint detected; Tieba frontend redesign breaking data-e2e/class selectors; region-restricted content.
Related errors
- Tieba may have blocked the hot page, or the DOM structure ma
- Tieba may have blocked the forum page, or the DOM structure
- Tieba may have blocked the result page, or the DOM structure
- 1point3acres thread
- 1point3acres user
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/697224bee474c476.
Report an issue: GitHub.