DIYgod/RSSHub · warning · Error
No content found. The page structure might have changed.
Error message
No content found. The page structure might have changed.
What it means
Thrown by the GMU graduate school route after loading the page HTML when the CSS selector '.n_listxx1 li' matches zero elements. This is a defensive guard indicating the target website's HTML structure has likely changed, making the scraper unable to find the article list.
Source
Thrown at lib/routes/gmu/yjs.ts:108
const { type, subtype } = ctx.req.param();
if (!Object.hasOwn(sections, type) || !Object.hasOwn(sections[type], subtype)) {
throw new Error('Invalid type or subtype');
}
const { title, path } = sections[type][subtype];
const baseUrl = 'https://yjs.gmu.cn';
const link = baseUrl + path;
const response = await got(link);
const $ = load(response.data);
// 更新选择器以匹配研究生院网站的实际结构
const list = $('.n_listxx1 li');
if (list.length === 0) {
throw new Error('No content found. The page structure might have changed.');
}
const items = await Promise.all(
list.toArray().map(async (item) => {
const element = $(item);
const a = element.find('a');
const dateText = element.find('span').text();
const href = a.attr('href');
const itemTitle = a.text().trim();
if (!href || !itemTitle) {
return null;
}
const pubDate = parseDate(dateText);
if (!pubDate) {
return null;
}View on GitHub (pinned to bed535e087)
Solutions
- Open the target URL (https://yjs.gmu.cn{path}) in a browser and inspect the current HTML to find the correct CSS selector
- Update the '.n_listxx1 li' selector in the source to match the new page structure
- If the page is genuinely empty, consider adding allowEmpty: true to the route's return object
- File an issue on the RSSHub GitHub repo with the new selector
Example fix
// before
const list = $('.n_listxx1 li');
if (list.length === 0) {
throw new Error('No content found. The page structure might have changed.');
}
// after (update selector after inspecting new page structure)
const list = $('.n_listxx1 li, .article-list li'); // fallback selector
if (list.length === 0) {
throw new Error(`No content found at ${link}. The page structure might have changed. Selector '.n_listxx1 li' returned 0 elements.`);
} Defensive patterns
Strategy: try-catch
Try / catch
// Wrap page loading in try-catch and provide a graceful fallback
try {
const list = $('.n_listxx1 li');
if (list.length === 0) {
// Log diagnostic and return allowEmpty instead of throwing
console.warn(`No content at ${link} with selector .n_listxx1 li`);
return { title, link, description: title, item: [], allowEmpty: true };
}
// ... process list
} catch (e) {
throw new Error(`Failed to parse ${link}: ${e.message}`);
} Prevention
- Monitor route health and alert when feeds return empty
- Use multiple fallback CSS selectors when scraping government sites
- Add allowEmpty: true to return objects for routes that may legitimately have no content
- Document the expected page structure so maintainers can update selectors quickly
When it happens
Trigger: The GET to https://yjs.gmu.cn{path} succeeds (HTTP 200) but the returned HTML does not contain any <li> elements inside a container with class 'n_listxx1'. This happens when the site is redesigned, the class name changes, or the page is temporarily empty.
Common situations: The GMU graduate school website was redesigned and CSS class names changed; the specific section page is temporarily empty (no articles posted); a maintenance page replaced the normal content; the wrong path resolved to a page without the expected list structure.
Related errors
- Data source ID not found
- Unknown host: ${url.host}
- Unknown handled type: ${element.type}, ${JSON.stringify(elem
- 暂不支持对${type}的订阅
- 暂不支持对${type}的订阅
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/e042dda5edbff347.
Report an issue: GitHub.