{"record":{"id":"e042dda5edbff347","repo":"DIYgod/RSSHub","slug":"no-content-found-the-page-structure-might-have-ch","errorCode":null,"errorMessage":"No content found. The page structure might have changed.","messagePattern":"No content found\\. The page structure might have changed\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"lib/routes/gmu/yjs.ts","lineNumber":108,"sourceCode":"    const { type, subtype } = ctx.req.param();\n\n    if (!Object.hasOwn(sections, type) || !Object.hasOwn(sections[type], subtype)) {\n        throw new Error('Invalid type or subtype');\n    }\n\n    const { title, path } = sections[type][subtype];\n    const baseUrl = 'https://yjs.gmu.cn';\n    const link = baseUrl + path;\n\n    const response = await got(link);\n\n    const $ = load(response.data);\n\n    // 更新选择器以匹配研究生院网站的实际结构\n    const list = $('.n_listxx1 li');\n\n    if (list.length === 0) {\n        throw new Error('No content found. The page structure might have changed.');\n    }\n\n    const items = await Promise.all(\n        list.toArray().map(async (item) => {\n            const element = $(item);\n            const a = element.find('a');\n            const dateText = element.find('span').text();\n            const href = a.attr('href');\n            const itemTitle = a.text().trim();\n\n            if (!href || !itemTitle) {\n                return null;\n            }\n\n            const pubDate = parseDate(dateText);\n            if (!pubDate) {\n                return null;\n            }","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/gmu/yjs.ts#L90-L126","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nconst list = $('.n_listxx1 li');\nif (list.length === 0) {\n    throw new Error('No content found. The page structure might have changed.');\n}\n\n// after (update selector after inspecting new page structure)\nconst list = $('.n_listxx1 li, .article-list li');  // fallback selector\nif (list.length === 0) {\n    throw new Error(`No content found at ${link}. The page structure might have changed. Selector '.n_listxx1 li' returned 0 elements.`);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Wrap page loading in try-catch and provide a graceful fallback\ntry {\n    const list = $('.n_listxx1 li');\n    if (list.length === 0) {\n        // Log diagnostic and return allowEmpty instead of throwing\n        console.warn(`No content at ${link} with selector .n_listxx1 li`);\n        return { title, link, description: title, item: [], allowEmpty: true };\n    }\n    // ... process list\n} catch (e) {\n    throw new Error(`Failed to parse ${link}: ${e.message}`);\n}","preventionTips":["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"],"tags":["scraper","css-selector","site-redesign","brittle"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}