Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
use new template verbiage to clarify BrowserProfile
Nick Sweetingb927471af3b3
diff --git a/docs/customize/browser-settings.mdx b/docs/customize/browser-settings.mdxindex 7b04e92a2..71e0c1b80 100644--- a/docs/customize/browser-settings.mdx+++ b/docs/customize/browser-settings.mdx@@ -8,15 +8,15 @@ Browser Use uses [playwright](https://playwright.dev/python/docs/api/class-brows----**To launch a new browser**, pass any playwright args you want to use to `BrowserSession(...)`:+**To launch or connect to a browser**, pass any playwright / browser-use configuration arguments you want to `BrowserSession(...)`:```pythonfrom browser_use import BrowserSession, Agentbrowser_session = BrowserSession(+ headless=True,+ viewport={'width': 964, 'height': 647},user_data_dir='~/.config/browseruse/profiles/default',- headless=False,- #... other config here ...)agent = Agent('fill out the form on this page', browser_session=browser_session)```@@ -33,11 +33,11 @@ agent = Agent('fill out the form on this page', browser_session=browser_session)- `BrowserSession(**params)` is Browser Use's object that tracks a connection to a running browser. It sets up:- the `playwright`, `browser`, `browser_context`, and `page` objects and tracks which tabs the agent/human are focused on- methods to interact with the browser window, apply config needed by the Agent, and run the `DOMService` for element detection- - it can take extra `**kwargs` to pass to playwright or a `browser_profile=BrowserProfile(...)` containing some config+ - it can take a `browser_profile=BrowserProfile(...)` template containing some config defaults, and `**kwargs` session-specific config overrides### Browser Connection Parameters-Provide any one of these options to connect to an existing browser. These options are session-specific and cannot be stored in a `BrowserProfile(...)`.+Provide any one of these options to connect to an existing browser. These options are session-specific and cannot be stored in a `BrowserProfile(...)` template.#### `wss_url`@@ -77,7 +77,7 @@ PID of a running chromium-based browser process to connect to on localhost. Seebrowser_profile: BrowserProfile = BrowserProfile()```-Optional BrowserProfile instance containing config to use for the BrowserSession. (see below for more info)+Optional `BrowserProfile` template containing default config to use for the `BrowserSession`. (see below for more info)#### `playwright`@@ -134,9 +134,9 @@ Mark BrowserSession as already initialized, skips launch/connection (not recomme#### `**kwargs``BrowserSession` can also accept *all* of the parameters [below](#browserprofile).-(the parameters *above* this point are specific to `BrowserSession` and cannot be stored in a `BrowserProfile`)+(the parameters *above* this point are specific to `BrowserSession` and cannot be stored in a `BrowserProfile` template)-Extra `**kwargs` passed to `BrowserSession` act as session-specific overrides, so you can pass anything `BrowserProfile(...)` takes (see below).+Extra `**kwargs` passed to `BrowserSession(...)` act as session-specific overrides to the `BrowserProfile(...)` template.```pythonbase_iphone13 = BrowserProfile(@@ -163,11 +163,11 @@ await asyncio.gather(agent1.run(), agent2.run())## `BrowserProfile`-A `BrowserProfile` is an optional static collection of configuration that can be passed around and validated before it's used to start a `BrowserSession(browser_profile=BrowserProfile(...))`.+A `BrowserProfile` is a static config template for a `BrowserSession()`.-It can take all the same standard [playwright arguments](#playwright) that `BrowserSession(...)` takes, and some extras as well.+It can validate and hold all the standard [playwright arguments](#playwright) and the extra config arguments Browser Use provides.-It allows you do do things like start multiple browsers with the same config easily:+It allows you do do things like start multiple browser processes with *some* shared config:```pythonfrom browser_use.browser import BrowserProfile@@ -187,7 +187,7 @@ browser3 = BrowserSession(browser_profile=browser_profile, user_data_dir='/tmp/p### Browser-Use Parameters-These parameters control browser-use specific features, and are outside the standard playwright parameter set but are supported by both `BrowserSession` and `BrowserProfile`.+These parameters control Browser Use-specific features, and are outside the standard playwright set. They can be passed to `BrowserSession(...)` and/or stored in a `BrowserProfile` template.#### `keep_alive`