Sessions provide a context manager for browser automation:

from notte_sdk import NotteClient

notte = NotteClient()
# The session is automatically stopped when the context manager is exited
with notte.Session(timeout_minutes=2) as session:  
	status = session.status()
	print(status)

Usage

See more operations on sessions:

Parameters

You can use the default parameters to create your session, or customize them:

headless
bool

Whether to run the session in headless mode.

timeout_minutes
int

Session timeout in minutes. Cannot exceed the global timeout.

proxies
list[typing.Annotated[notte_sdk.types.NotteProxy | notte_sdk.types.ExternalProxy, FieldInfo(annotation=NoneType, required=True, discriminator='type')]] | bool

List of custom proxies to use for the session. If True, the default proxies will be used.

browser_type
BrowserType

The browser type to use. Can be chromium, chrome or firefox.

user_agent
str | None

The user agent to use for the session

chrome_args
list

Overwrite the chrome instance arguments

viewport_width
int | None

The width of the viewport

viewport_height
int | None

The height of the viewport