Procedures

Automation procedures in the Browser Use book.

The following documentation is for Browser Use v1.13.2 (BDK).

to close a browser

Close a browser instance.

Input Concepts

Concept
Description
Type
Required
Default Value

A reference to the browser instance to delete.

browser instance

Yes

(no default)

Output Concepts

Concept
Description
Type

answer

None

boolean

Examples

Close a browser instance:

close the browser

to perform a task on a browser and get the visual log, the detailed plan, the result, the browser run id and the browser files

Execute a browser-based web automation task.

Note: Before using this procedure, you must first "provision a browser" for your automation task.

Input Concepts

Concept
Description
Type
Required
Default Value

The reference to the provisioned browser instance.

browser instance

Yes

(no default)

An object containing task configuration (created with the Browser Automation widget).

browser task

Yes

(no default)

Output Concepts

Concept
Description
Type

visual log

A series of screenshots showing each step the browser took.

file

detailed plan

A text summary of the steps taken to automate the task.

text

result

The data extracted or produced by the agent upon completing the task.

any

browser run id

The identifier of the browser run.

text

browser files

A list of files generated by the agent upon completing the task.

file

Examples

Get the Weather in Philadelphia. Task instructions: "Search for the 'current weather in Philadelphia' and extract the temperature"

Get Laptop Prices from Amazon. Task instructions: "Go to www.Amazon.com and search for 'laptop.' Look at the first 5 product listings on the results page. For each product, copy the product name and its price. Show me the list of product names with their prices."

to provision a browser

Provision a new browser instance for a web automation task.

Output Concepts

Concept
Description
Type

None

browser instance

Examples

Provision a browser and get the reference to the browser instance:

to run a playwright script on a browser and get the result, the browser run id and the browser files

Execute a custom Playwright script on the provisioned browser.

Note: Before using this procedure, you must first "provision a browser". The script must: 1. Be stored in S3 2. Contain an async function: run(page, context, browser, params, llm=None) 3. Be accessible from the browser farm's AWS credentials

Input Concepts

Concept
Description
Type
Required
Default Value

Reference to the provisioned browser instance.

browser instance

Yes

(no default)

playwright script

S3 URI of the Playwright script (e.g., "s3://bucket/scripts/my_script.py").

text

Yes

(no default)

parameter json

Optional dictionary of parameters to pass to the script.

json

No

(no default)

Output Concepts

Concept
Description
Type

result

Data returned by the script execution.

any

browser run id

Identifier of the browser run.

text

browser files

Files generated during script execution.

file

Examples

Run a custom data extraction script with parameters:

Last updated

Was this helpful?