# API Reference

## Core Functions

The main screenshot and PDF capture API

[webshot()](webshot.md#nokap.webshot)  
Take a screenshot or PDF of a web page.

[from_html()](from_html.md#nokap.from_html)  
Take a screenshot or PDF from an HTML string.

[close()](close.md#nokap.close)  
Explicitly close the module-level browser and CDP connection.

## Browser Management

Chrome process lifecycle and discovery

[Chrome](Chrome.md#nokap.Chrome)  
Manages a headless Chrome browser process.

[find_chrome()](find_chrome.md#nokap.find_chrome)  
Locate the Chrome or Chromium binary on the system.

[install_chrome()](install_chrome.md#nokap.install_chrome)  
Download `chrome-headless-shell` from Chrome for Testing into nokap's cache.

## Session

Low-level browser tab and navigation control

[Session](Session.md#nokap.Session)  
A CDP session representing a single browser tab.

## Errors

Exception hierarchy for error handling

[NokapError](NokapError.md#nokap.NokapError)  
Base exception for all nokap errors.

[CDPError](CDPError.md#nokap.CDPError)  
Error returned by the Chrome DevTools Protocol.

[ChromeNotFoundError](ChromeNotFoundError.md#nokap.ChromeNotFoundError)  
Raised when Chrome/Chromium cannot be found on the system.

[ChromeStartError](ChromeStartError.md#nokap.ChromeStartError)  
Raised when Chrome fails to start or report its DevTools URL.

[NavigationError](NavigationError.md#nokap.NavigationError)  
Raised when page navigation fails.

[PageLoadTimeout](PageLoadTimeout.md#nokap.PageLoadTimeout)  
Raised when a page does not finish loading within the timeout.

[SelectorError](SelectorError.md#nokap.SelectorError)  
Raised when a CSS selector matches no elements.

## Types

Type definitions for configuration

[PaperSize](PaperSize.md#nokap.PaperSize)  
