jackwener/OpenCLI · error · EmptyResultError
Tieba may have blocked the hot page, or the DOM structure ma
Error message
Tieba may have blocked the hot page, or the DOM structure may have changed
What it means
The tieba hot command extracts titles/links from the Baidu Tieba hot page DOM inside the browser. If zero items with titles are extracted, EmptyResultError('tieba hot', ...) is thrown — either the page was blocked (anti-bot/verify page) or Tieba's DOM changed so the selectors no longer match.
Source
Thrown at clis/tieba/hot.js:38
const raw = await page.evaluate(`(() => {
const items = document.querySelectorAll('li.topic-top-item');
return Array.from(items).map((item) => {
const titleEl = item.querySelector('a.topic-text');
const numEl = item.querySelector('span.topic-num');
const descEl = item.querySelector('p.topic-top-item-desc');
const href = titleEl?.getAttribute('href') || '';
return {
title: titleEl?.textContent?.trim() || '',
discussions: numEl?.textContent?.trim() || '',
description: descEl?.textContent?.trim() || '',
url: href.startsWith('http') ? href : 'https://tieba.baidu.com' + href,
};
}).filter((item) => item.title).slice(0, ${limit});
})()`);
const items = Array.isArray(raw) ? raw : [];
if (!items.length) {
throw new EmptyResultError('tieba hot', 'Tieba may have blocked the hot page, or the DOM structure may have changed');
}
return items.map((item, index) => ({
rank: index + 1,
title: item.title || '',
discussions: item.discussions || '',
description: item.description || '',
url: item.url || '',
}));
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Open the hot page in the controlled browser and inspect whether a verification interstitial is shown; solve it manually then retry
- Update the DOM selectors in clis/tieba/hot.js to match current markup after inspecting page.content()
- Slow down scrape frequency or rotate egress IP to avoid blocking
- Retry after a delay — blocks are often temporary
Defensive patterns
Strategy: try-catch
Validate before calling
const html = await page.content();
if (/verify|captcha|wappass/i.test(html)) throw new Error('Tieba verification interstitial — solve before scraping'); Type guard
function looksBlocked(html) {
return /security\/verify|captcha|wappass|百度安全验证/i.test(html);
} Try / catch
try {
const hot = await tiebaHot(page, { limit });
} catch (e) {
if (e instanceof EmptyResultError) {
console.warn('Tieba hot blocked or markup changed; skipping');
return [];
}
throw e;
} Prevention
- Throttle scrape frequency and reuse warm browser sessions
- Check for Baidu security-verify pages before parsing and solve them manually
- Snapshot page.content() when empty so you can update selectors quickly
- Pin selectors in one module and test against live markup periodically
When it happens
Trigger: Running the tieba hot scrape when the in-page evaluate returns an empty array: page served is a security-verification interstitial, region-blocked page, or the hot-list container/selector markup changed.
Common situations: Baidu serving captcha/verify pages to datacenter IPs; frequent scraping triggering rate limits; Tieba front-end redesign moving the hot list selectors; mobile-vs-pc template mismatch.
Related errors
- Tieba may have blocked the forum page, or the DOM structure
- Tieba may have blocked the thread page, or the DOM structure
- 1point3acres thread
- 1point3acres user
- amazon ${definition.commandName} did not expose any ranked i
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/e0d631aa9e52d569.
Report an issue: GitHub.