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:
session_id
UnionType[str, None]
default:"None"
storage
UnionType[RemoteFileStorage, None]
default:"None"
File Storage to attach to the session
perception_type
Literal[fast, deep]
default:"fast"
raise_on_failure
bool
default:"True"
headless
bool
Whether to run the session in headless mode.
solve_captchas
bool
Whether to try to automatically solve captchas
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
typing.Literal['chromium', 'chrome', 'firefox']
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
cdp_url
str | None
The CDP URL of another remote session provider.
use_file_storage
bool
Whether FileStorage should be attached to the session.