Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Update browser_use/tools/service.py

Magnus Müller2d514fd32257
diff --git a/browser_use/tools/service.py b/browser_use/tools/service.py
index aa9768a74..f8e590e24 100644
--- a/browser_use/tools/service.py
+++ b/browser_use/tools/service.py
@@ -948,7 +948,7 @@ You can also use it to explore the website.
- Don't write comments in here, no human reads that.
- Write only valid js code.
- use this to e.g. extract + filter links, convert the page to json into the format you need etc...
-- wrap your code in a function(){{ ... }})() or (async function(){{ ... }})() for async code
+- wrap your code in (function(){ ... })() or (async function(){ ... })() for async code
- wrap your code in a try catch block
- limit the output otherwise your context will explode
- think if you deal with special elements like iframes / shadow roots etc