{"record":{"id":"97aec4e8146f5577","repo":"projectdiscovery/katana","slug":"could-not-get-page-info","errorCode":null,"errorMessage":"could not get page info","messagePattern":"could not get page info","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/engine/headless/browser/element.go","lineNumber":118,"sourceCode":"\n\t\tif _, found := unique[hash]; found {\n\t\t\tcontinue\n\t\t}\n\t\tunique[hash] = struct{}{}\n\t\tnavigations = append(navigations, &types.Action{\n\t\t\tType:    types.ActionTypeLeftClick,\n\t\t\tElement: button,\n\t\t})\n\t}\n\n\tscopeValidator := b.launcher.ScopeValidator()\n\tlinks, err := b.GetAllElements(linksCSSSelector)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not get links\")\n\t}\n\tinfo, err := b.Info()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not get page info\")\n\t}\n\tfor _, link := range links {\n\t\thref := link.Attributes[\"href\"]\n\t\tif href == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tresolvedHref, err := resolveURL(info.URL, href)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tu, err := url.Parse(resolvedHref)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tif u.Scheme != \"http\" && u.Scheme != \"https\" {\n\t\t\tcontinue","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/projectdiscovery/katana/blob/e3e742739c3746f085943ce918fb4e2b8daf6fe6/pkg/engine/headless/browser/element.go#L100-L136","documentation":"Wrapper error from FindNavigations when b.Info() fails. Info fetches page metadata (URL, title) from the browser; the error means the CDP call behind it failed, so anchor hrefs cannot be resolved against the page URL. It aborts the rest of navigation discovery.","triggerScenarios":"1) The page or its target (frame) was closed before Info() ran. 2) The CDP session dropped (browser crash, transport failure). 3) Calling after navigation completed and the frame is detached. 4) A hooked page navigation replaced the target mid-discovery.","commonSituations":"Crawling fast-redirecting sites; long crawls where a tab dies and stale page handles are reused; concurrent crawling exceeding browser limits.","solutions":["Re-acquire the page after navigation instead of reusing a stale BrowserPage handle","Verify the browser process is alive; restart headless Chrome on repeated failures","Check Info() before running the full discovery and skip dead pages early","Update katana/chromedp; older versions leak detached-frame errors"],"exampleFix":"// before\ninfo, err := page.Info()\nif err != nil { panic(err) }\n// after\ninfo, err := page.Info()\nif err != nil {\n    logger.Warn(\"page info unavailable, skipping page\", slog.String(\"error\", err.Error()))\n    return nil\n}","handlingStrategy":"try-catch","validationCode":"info, err := page.Info()\nif err != nil || info.URL == \"\" || info.URL == \"about:blank\" {\n    return // page not ready for discovery\n}","typeGuard":"func hasValidTarget(p *browser.BrowserPage) bool {\n    info, err := p.Info()\n    return err == nil && info.URL != \"\" && info.URL != \"about:blank\"\n}","tryCatchPattern":"navs, err := page.FindNavigations()\nif err != nil {\n    logger.Debug(\"page info failed; dropping page\", slog.String(\"error\", err.Error()))\n    return\n}","preventionTips":["Don't reuse stale BrowserPage handles after navigation","Check Info() early and abandon dead pages","Restart headless Chrome on repeated target failures","Cap concurrency to keep the browser stable"],"tags":["headless-browser","page-info","crawl"],"backgroundTag":"cdp-target-closed","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"}