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
Initial actions
magmuellerc843ba3021ab
diff --git a/docs/customize/agent-settings.mdx b/docs/customize/agent-settings.mdxindex 6d11250c8..c2ca6bd7c 100644--- a/docs/customize/agent-settings.mdx+++ b/docs/customize/agent-settings.mdx@@ -163,3 +163,30 @@ The `AgentHistoryList` provides many helper methods to analyze the execution:</Note>++## Run initial actions without LLM+With [this example](https://github.com/browser-use/browser-use/blob/main/examples/features/initial_actions.py) you can run initial actions without the LLM.+Specify the action as a dictionary where the key is the action name and the value is the action parameters. You can find all our actions in the [Controller](https://github.com/browser-use/browser-use/blob/main/browser_use/controller/service.py) source code.+```python++initial_actions = [+ {'open_tab': {'url': 'https://www.google.com'}},+ {'open_tab': {'url': 'https://en.wikipedia.org/wiki/Randomness'}},+ {'scroll_down': {'amount': 1000}},+ {'extract_content': {'include_links': False}},+]+agent = Agent(+ task='What theories are displayed on the page?',+ initial_actions=initial_actions,+ llm=llm,+)+```++## Rerunning the Agent without LLM++++## Viewport extension++## Visable elements+diff --git a/examples/features/initial_actions.py b/examples/features/initial_actions.pyindex e2de36404..45de0bb30 100644--- a/examples/features/initial_actions.py+++ b/examples/features/initial_actions.py@@ -8,12 +8,12 @@ llm = ChatOpenAI(model='gpt-4o')initial_actions = [{'open_tab': {'url': 'https://www.google.com'}},- {'input_text': {'index': 5, 'text': 'Whats the next hot AI company?'}},- {'send_keys': {'keys': 'Enter'}},- {'extract_content': {'include_links': True}},+ {'open_tab': {'url': 'https://en.wikipedia.org/wiki/Randomness'}},+ {'scroll_down': {'amount': 1000}},+ {'extract_content': {'include_links': False}},]agent = Agent(- task='Go to each company and quickly summarize what they do.',+ task='What theories are displayed on the page?',initial_actions=initial_actions,llm=llm,)