Browser automation for Jido AI agents.
Jido.Browser provides a flat browser API backed by pluggable adapters.
In 2.0, the default adapter is Jido.Browser.Adapters.AgentBrowser.
Summary
Functions
Navigates back in browser history.
Clicks an element identified by a selector or agent-browser ref.
Closes the current tab or a specific tab by index.
Returns captured browser console messages when supported by the adapter.
Ends an active browser session.
Returns captured browser runtime errors when supported by the adapter.
Evaluates JavaScript in the browser when the adapter supports it.
Extracts page content as markdown, HTML, or text.
Focuses an element.
Navigates forward in browser history.
Reads an attribute value from an element.
Returns the current session status, including URL, title, and liveness.
Reads text content from one or more matching elements.
Returns the current page title.
Returns the current page URL.
Moves the pointer over an element.
Checks whether an element exists and is visible.
Lists open browser tabs.
Restores browser session state from disk.
Navigates the current session to a URL.
Opens a new tab, optionally at a URL.
Queries a selector and returns a stable element summary.
Reloads the current page.
Persists browser session state to disk.
Captures a screenshot of the current page.
Scrolls the page, by coordinates, direction, or to a specific element.
Selects an option in a form control.
Returns an agent-oriented page snapshot with ref metadata when supported.
Starts a warm browser pool for adapters that support pooled sessions.
Starts a browser session using the configured adapter or an explicit adapter override.
Stops a previously started warm browser pool.
Switches to a tab by index.
Types text into an element identified by a selector or agent-browser ref.
Waits for a navigation or URL change to complete.
Waits for a selector to reach a requested state.
Fetches a URL over HTTP(S) without starting a browser session.
Functions
@spec back( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Navigates back in browser history.
@spec click(Jido.Browser.Session.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Clicks an element identified by a selector or agent-browser ref.
@spec close_tab(Jido.Browser.Session.t(), non_neg_integer() | nil, keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Closes the current tab or a specific tab by index.
@spec console( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Returns captured browser console messages when supported by the adapter.
@spec end_session(Jido.Browser.Session.t()) :: :ok | {:error, term()}
Ends an active browser session.
@spec errors( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Returns captured browser runtime errors when supported by the adapter.
@spec evaluate(Jido.Browser.Session.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Evaluates JavaScript in the browser when the adapter supports it.
@spec extract_content( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Extracts page content as markdown, HTML, or text.
@spec focus(Jido.Browser.Session.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Focuses an element.
@spec forward( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Navigates forward in browser history.
@spec get_attribute(Jido.Browser.Session.t(), String.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Reads an attribute value from an element.
@spec get_status( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Returns the current session status, including URL, title, and liveness.
@spec get_text(Jido.Browser.Session.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Reads text content from one or more matching elements.
@spec get_title( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Returns the current page title.
@spec get_url( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Returns the current page URL.
@spec hover(Jido.Browser.Session.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Moves the pointer over an element.
@spec is_visible(Jido.Browser.Session.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Checks whether an element exists and is visible.
@spec list_tabs( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Lists open browser tabs.
@spec load_state(Jido.Browser.Session.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Restores browser session state from disk.
@spec new_tab(Jido.Browser.Session.t(), String.t() | nil, keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Opens a new tab, optionally at a URL.
@spec query(Jido.Browser.Session.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Queries a selector and returns a stable element summary.
@spec reload( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Reloads the current page.
@spec save_state(Jido.Browser.Session.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Persists browser session state to disk.
@spec screenshot( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Captures a screenshot of the current page.
@spec scroll( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Scrolls the page, by coordinates, direction, or to a specific element.
@spec select_option(Jido.Browser.Session.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Selects an option in a form control.
@spec snapshot( Jido.Browser.Session.t(), keyword() ) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Returns an agent-oriented page snapshot with ref metadata when supported.
Starts a warm browser pool for adapters that support pooled sessions.
This is intended for scripts, tests, and ad hoc startup. OTP applications
should prefer adding Jido.Browser.Pool to their supervision tree.
@spec start_session(keyword()) :: {:ok, Jido.Browser.Session.t()} | {:error, term()}
Starts a browser session using the configured adapter or an explicit adapter override.
Stops a previously started warm browser pool.
@spec switch_tab(Jido.Browser.Session.t(), non_neg_integer(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Switches to a tab by index.
@spec type(Jido.Browser.Session.t(), String.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Types text into an element identified by a selector or agent-browser ref.
@spec wait_for_selector(Jido.Browser.Session.t(), String.t(), keyword()) :: {:ok, Jido.Browser.Session.t(), map()} | {:error, term()}
Waits for a selector to reach a requested state.
Fetches a URL over HTTP(S) without starting a browser session.
HTML responses keep native selector extraction and format conversion, while
fetched binary documents such as PDFs and office files are extracted through
ExtractousEx.