projectdiscovery/katana · error
could not get page info
Error message
could not get page info
What it means
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.
Source
Thrown at pkg/engine/headless/browser/element.go:118
if _, found := unique[hash]; found {
continue
}
unique[hash] = struct{}{}
navigations = append(navigations, &types.Action{
Type: types.ActionTypeLeftClick,
Element: button,
})
}
scopeValidator := b.launcher.ScopeValidator()
links, err := b.GetAllElements(linksCSSSelector)
if err != nil {
return nil, errors.Wrap(err, "could not get links")
}
info, err := b.Info()
if err != nil {
return nil, errors.Wrap(err, "could not get page info")
}
for _, link := range links {
href := link.Attributes["href"]
if href == "" {
continue
}
resolvedHref, err := resolveURL(info.URL, href)
if err != nil {
continue
}
u, err := url.Parse(resolvedHref)
if err != nil {
continue
}
if u.Scheme != "http" && u.Scheme != "https" {
continueView on GitHub (pinned to e3e742739c)
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
Example fix
// before
info, err := page.Info()
if err != nil { panic(err) }
// after
info, err := page.Info()
if err != nil {
logger.Warn("page info unavailable, skipping page", slog.String("error", err.Error()))
return nil
} Defensive patterns
Strategy: try-catch
Validate before calling
info, err := page.Info()
if err != nil || info.URL == "" || info.URL == "about:blank" {
return // page not ready for discovery
} Type guard
func hasValidTarget(p *browser.BrowserPage) bool {
info, err := p.Info()
return err == nil && info.URL != "" && info.URL != "about:blank"
} Try / catch
navs, err := page.FindNavigations()
if err != nil {
logger.Debug("page info failed; dropping page", slog.String("error", err.Error()))
return
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Crawling fast-redirecting sites; long crawls where a tab dies and stale page handles are reused; concurrent crawling exceeding browser limits.
Related errors
- could not get forms
- could not get buttons
- could not get links
- could not get event listeners
- could not get page state
AI-assisted analysis of projectdiscovery/katana@e3e742739c (2026-09-03).
Data as JSON: /api/errors/97aec4e8146f5577.
Report an issue: GitHub.