SimpleTextBrowser

SimpleTextBrowser(
    start_page: str | None = None,
    viewport_size: int | None = 8192,
    downloads_folder: str | None = None,
    bing_base_url: str = 'https://api.bing.microsoft.com/v7.0/search',
    bing_api_key: str | None = None,
    request_kwargs: dict[str, Any] | None = None
)

(In preview) An extremely simple text-based web browser comparable to Lynx. Suitable for Agentic use.
Initialize the browser with the given parameters.

Parameters:
NameDescription
start_pageType: str | None

Default: None
viewport_sizeType: int | None

Default: 8192
downloads_folderType: str | None

Default: None
bing_base_urlType: str

Default: ‘https
bing_api_keyType: str | None

Default: None
request_kwargsType: dict[str, typing.Any] | None

Default: None

Instance Attributes

address


Return the address of the current page.

page_content


Return the full contents of the current page.

viewport


Return the content of the current viewport.

Instance Methods

page_down

page_down(self) -> None

Move the viewport down by one page.


page_up

page_up(self) -> None

Move the viewport up by one page.


set_address

set_address(self, uri_or_path: str) -> None

Set the address of the current page.

Parameters:
NameDescription
uri_or_pathThe URI or path to set as the current page.

Type: str

visit_page

visit_page(self, path_or_uri: str) -> str

Update the address, visit the page, and return the content of the viewport.

Parameters:
NameDescription
path_or_uriThe URI or path to visit.

Type: str