DIYgod/RSSHub · error · Error
No search results found. The page structure may have changed
Error message
No search results found. The page structure may have changed.
What it means
The Tieba search route loads /f/search/res and selects '.thread-content-box' after waiting for that selector (3s timeout). If the selector matches nothing it throws, meaning either the page never rendered the results (timeout/anti-bot) or Baidu renamed the result container.
Source
Thrown at lib/routes/baidu/tieba/search.tsx:62
const qw = ctx.req.param('qw');
const query = new URLSearchParams(ctx.req.param('routeParams'));
query.set('ie', 'utf-8');
query.set('qw', qw);
query.set('rn', query.get('rn') || '20');
const link = `https://tieba.baidu.com/f/search/res?${query.toString()}`;
const html = await getTiebaPageContent(link, `tieba:search:${qw}:${query.toString()}`, {
waitForSelector: '.thread-content-box',
timeout: 3000,
});
const $ = load(html);
const resultList = $('.thread-content-box');
if (resultList.length === 0) {
throw new Error('No search results found. The page structure may have changed.');
}
return {
title: `${qw} - ${query.get('kw') || '百度贴'}吧搜索`,
link,
item: resultList.toArray().map((element) => {
const item = $(element);
// 标题
const title = item.find('.title-content-wrap .title-wrap span').text().trim();
// 内容摘要
const details = item.find('.abstract-wrap span').text().trim();
// 从链接中提取帖子URL,并规范化为绝对地址
const linkPath = item.find('.action-bar-warp a.action-link-bg').attr('href') || '';
const linkHref = normalizeUrl(linkPath);
View on GitHub (pinned to bed535e087)
Solutions
- Increase the waitForSelector timeout (lib/routes/baidu/tieba/search.tsx:58) if render is slow.
- Refresh BAIDU_COOKIE if the page is being redirected to a login/captcha.
- Confirm in a browser that the search query returns results; if Baidu renamed the class, update the selector.
Example fix
// before waitForSelector: '.thread-content-box', timeout: 3000, // after waitForSelector: '.thread-content-box', timeout: 8000,
Defensive patterns
Strategy: retry
Validate before calling
const MIN_TIMEOUT_MS = 5000;
function timeoutIsSane(ms: number): boolean { return ms >= MIN_TIMEOUT_MS; } Type guard
const pageHasResults = ($: ReturnType<typeof load>): boolean =>
$('.thread-content-box').length > 0; Try / catch
try {
return await handler(ctx);
} catch (e) {
if (e instanceof Error && /No search results found/.test(e.message)) {
// bump waitForSelector timeout and retry once
return await handler({ ...ctx, _timeout: 8000 });
}
throw e;
} Prevention
- Use a waitForSelector timeout >= 5s so slow Vue rendering does not false-fail.
- Keep BAIDU_COOKIE fresh to avoid being served an anti-bot page.
- Record the page HTML on failure so selector drift is diagnosable.
When it happens
Trigger: getTiebaPageContent returns HTML with zero '.thread-content-box' elements - either because waitForSelector timed out at 3000ms before the Vue-rendered results appeared, or the search genuinely had no results, or an anti-bot page was served.
Common situations: Slow connection/JS render exceeding the 3s timeout; BAIDU_COOKIE issues returning a non-result page; Baidu renaming the '.thread-content-box' class; a query that legitimately has zero matches.
Related errors
- No post replies found. The post may not exist or the cookie
- No user posts found. The page structure may have changed or
- Tieba API error: ${data.error_msg || data.error_code}
- No threads found. The cookie may be expired or invalid. Plea
- Unable to find s-data in page
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/369dbd4faa08dd6b.
Report an issue: GitHub.