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
Improve prompt
magmueller8e31e82919d8
diff --git a/browser_use/agent/prompts.py b/browser_use/agent/prompts.pyindex 6569b3de2..78c607757 100644--- a/browser_use/agent/prompts.py+++ b/browser_use/agent/prompts.py@@ -74,7 +74,7 @@ class SystemPrompt:- Each action should logically follow from the previous one- If the page changes between actions, the sequence is interrupted and you get the new page state.- Only provide the action sequence until you think the DOM will change.- - Try to be efficient. If the dom changes a little bit we find the right element.+ - Try to be efficient, e.g. accept cookies and direct next action. If the dom changes a little bit we find the right element."""def input_format(self) -> str:diff --git a/examples/find_and_apply_to_jobs.py b/examples/find_and_apply_to_jobs.pyindex 6aec338f3..0225ee778 100644--- a/examples/find_and_apply_to_jobs.py+++ b/examples/find_and_apply_to_jobs.py@@ -28,7 +28,7 @@ from browser_use import ActionResult, Agent, BrowserConfig, Controllerload_dotenv()-controller = Controller(browser_config=BrowserConfig(keep_open=True))+controller = Controller(browser_config=BrowserConfig(keep_open=True, disable_security=True))CV = Path.cwd() / 'cv_04_24.pdf'@@ -58,9 +58,9 @@ def read_jobs():return f.read()[email protected]('Ask me for help')-def ask_human(question: str) -> str:- return input(f'\n{question}\nInput: ')+# @controller.action('Ask me for help')+# def ask_human(question: str) -> str:+# return input(f'\n{question}\nInput: ')@controller.action('Read my cv for context to fill forms')@@ -91,10 +91,14 @@ async def close_file_dialog(browser: Browser):async def main():task = (- 'Read my cv & find machine learning engineer jobs in Bangalore for me. '+ 'You are a professional job finder and applyer. '+ 'Read my cv & find 10 machine learning engineer jobs in Bangalore for me + apply me to them. ''Save them to a file'- 'then start applying for them in new tabs - please not via job portals like linkedin, indeed, etc. '- 'If you need more information or help, ask me.'+ 'use multiple tabs'+ 'please avoid job portals like linkedin, indeed, etc. '+ 'do everything you should do like uploading cv, motivation letter, etc. '+ 'if you get stuck simply find a new job '+ 'start with https://www.inmobi.com/company/openings/fte/jobid/6115486?utm_campaign=google_jobs_apply&utm_source=google_jobs_apply&utm_medium=organic')model = ChatOpenAI(model='gpt-4o')agent = Agent(task=task, llm=model, controller=controller)