{"record":{"id":"4603ef0c97ae849d","repo":"Mintplex-Labs/anything-llm","slug":"there-was-no-content-to-be-collected-or-read","errorCode":null,"errorMessage":"There was no content to be collected or read.","messagePattern":"There was no content to be collected or read\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"server/utils/agentFlows/executors/web-scraping.js","lineNumber":40,"sourceCode":"\n  const captureMode = captureAs === \"querySelector\" ? \"html\" : captureAs;\n  introspect(`Scraping the content of ${url} as ${captureAs}`);\n  const { success, content } = await new CollectorApi()\n    .getLinkContent(url, captureMode)\n    .then((res) => {\n      if (captureAs !== \"querySelector\") return res;\n      return parseHTMLwithSelector(res.content, config.querySelector, context);\n    });\n\n  if (!success) {\n    introspect(`Could not scrape ${url}. Cannot use this page's content.`);\n    throw new Error(\"URL could not be scraped and no content was found.\");\n  }\n\n  introspect(`Successfully scraped content from ${url}`);\n  if (!content || content?.length === 0) {\n    introspect(\"There was no content to be collected or read.\");\n    throw new Error(\"There was no content to be collected or read.\");\n  }\n\n  if (!enableSummarization) {\n    logger(`Returning raw content as summarization is disabled`);\n    return content;\n  }\n\n  const tokenCount = new TokenManager(\n    aibitat.defaultProvider.model\n  ).countFromString(content);\n  const contextLimit = Provider.contextLimit(\n    aibitat.defaultProvider.provider,\n    aibitat.defaultProvider.model\n  );\n\n  if (tokenCount < contextLimit) {\n    logger(\n      `Content within token limit (${tokenCount}/${contextLimit}). Returning raw content.`","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agentFlows/executors/web-scraping.js#L22-L58","documentation":"Thrown when the scrape reported success:true but the returned content is null, undefined, or an empty string. The page loaded and the collector returned a result, but there was no extractable text. This is a softer failure than 385: the fetch worked, the content did not.","triggerScenarios":"The page is effectively empty of text (only images/media); the captureAs mode extracted nothing usable; a querySelector matched elements but their inner HTML was empty; the page's text is entirely behind rendering the collector cannot do.","commonSituations":"Scraping an image gallery, a PDF viewed via an embed, or a page whose visible text is injected client-side after load; captureAs set to a mode that does not match the page's structure.","solutions":["Change captureAs to a different mode (e.g., html instead of text) to capture raw markup.","Confirm the page actually contains text content in its static HTML.","If summarization is disabled and content is empty, the page genuinely had no text - choose a different source.","Verify the querySelector targets an element that contains text."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  result = await executeWebScraping(config, context);\n} catch (error) {\n  if (error.message.includes(\"no content\")) {\n    // optionally retry with captureAs: \"html\" to capture raw markup\n  } else throw error;\n}","preventionTips":["Choose a captureAs mode that matches the page structure (text vs html vs querySelector).","Verify the target page has real text content in its static HTML.","When using querySelector, confirm the selector matches non-empty elements."],"tags":["web-scraping","content","agent-flows"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}