jeecgboot/JeecgBoot · warning · JeecgBootException

网页内容为空,请检查URL是否可访问

Error message

网页内容为空,请检查URL是否可访问

What it means

Thrown by EmbeddingHandler.parseWebPage() when WebPageParser.parseToMarkdown(website) returns an empty or null result. This means the HTTP fetch succeeded (or returned a response) but the extracted content was empty — the page exists but yielded no parseable text.

Source

Thrown at jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/llm/handler/EmbeddingHandler.java:780

     * @date 2026/3/19
     */
    private String parseWebPage(AiragKnowledgeDoc doc) {
        String metadata = doc.getMetadata();
        AssertUtils.assertNotEmpty("请先配置网页URL", metadata);
        JSONObject metadataJson = JSONObject.parseObject(metadata);
        String website = metadataJson.getString(LLMConsts.KNOWLEDGE_DOC_METADATA_WEBSITE);
        AssertUtils.assertNotEmpty("请先配置网页URL", website);

        Matcher matcher = LLMConsts.WEB_PATTERN.matcher(website);
        if (!matcher.matches()) {
            throw new JeecgBootException("网页URL格式不正确,请以http://或https://开头");
        }

        try {
            WebPageParser webPageParser = new WebPageParser();
            String content = webPageParser.parseToMarkdown(website);
            if (oConvertUtils.isEmpty(content)) {
                throw new JeecgBootException("网页内容为空,请检查URL是否可访问");
            }
            log.info("网页解析成功, URL: {}, 内容长度: {}", website, content.length());
            return content;
        } catch (JeecgBootException e) {
            throw e;
        } catch (Exception e) {
            log.error("网页解析失败, URL: {}, 错误: {}", website, e.getMessage(), e);
            throw new JeecgBootException("网页解析失败: " + e.getMessage());
        }
    }

    /**
     * 解析文件
     *
     * @param doc
     * @author chenrui
     * @date 2025/3/5 11:31
     */

View on GitHub (pinned to 96fb33f5ec)

Solutions

  1. Open the URL in a browser to confirm it has visible text content (not purely JavaScript-rendered).
  2. If the page requires JavaScript, consider pre-rendering the page or using a different source.
  3. Check that the URL is not behind authentication or a paywall.
  4. Verify network connectivity and proxy settings allow the server to reach the target URL.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    String content = parseWebPage(doc);
} catch (JeecgBootException e) {
    if (e.getMessage().contains("网页内容为空")) {
        // suggest user verify the URL renders server-side content
        throw new JeecgBootException("网页内容为空,该页面可能需要JavaScript渲染,请尝试其他URL");
    }
    throw e;
}

Prevention

When it happens

Trigger: The target URL is reachable but returns a page with no extractable text content: a JavaScript-only SPA with no server-rendered HTML; a page that returned an empty body; a page blocked by a CAPTCHA or paywall returning minimal HTML; a page that returned a 200 status with an error/landing page body.

Common situations: Target site is a single-page application whose content loads via JavaScript (WebPageParser likely does not execute JS); the URL redirects to a login/error page with no content; the site blocks scraping bots and returns an empty response; network proxy interferes and returns an empty body.

Related errors


AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14). Data as JSON: /api/errors/b47141fdfed01e67. Report an issue: GitHub.