{"record":{"id":"28ee7c61f3b9bfb3","repo":"projectdiscovery/katana","slug":"could-not-get-html-content","errorCode":null,"errorMessage":"could not get html content","messagePattern":"could not get html content","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/engine/headless/crawler/state.go","lineNumber":78,"sourceCode":"\touterHTML, err := page.HTML()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not get html content\")\n\t}\n\n\tstate := &types.PageState{\n\t\tURL:              pageInfo.URL,\n\t\tDOM:              outerHTML,\n\t\tNavigationAction: action,\n\t\tTitle:            pageInfo.Title,\n\t}\n\tif action != nil {\n\t\tstate.Depth = action.Depth + 1\n\t}","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/projectdiscovery/katana/blob/e3e742739c3746f085943ce918fb4e2b8daf6fe6/pkg/engine/headless/crawler/state.go#L60-L96","documentation":"newPageState fails when browser.Page.HTML() cannot return the page's outer HTML, even though page.Info() succeeded. This typically happens when the page navigated or was closed between the Info and HTML calls, or the DOM serialization failed in the browser.","triggerScenarios":"Thrown at pkg/engine/headless/crawler/state.go:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the page is still open/attached; reopen or re-navigate if the tab was closed mid-crawl","Retry page.HTML() once, as navigation races between Info() and HTML() are transient","Log the wrapped cause to identify whether the renderer or CDP connection failed","Return a non-fatal error so crawlFn can skip this state instead of aborting the crawl"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e3e742739c3746f085943ce918fb4e2b8daf6fe6","analyzedAt":"2026-09-03T14:55:13.248Z","contentChangedAt":"2026-09-03T14:55:13.248Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}