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
Better instructions
Magnus Müller23e4521109e7
diff --git a/examples/browser/using_cdp.py b/examples/browser/using_cdp.pyindex b5c3b9567..4a9dcacaa 100644--- a/examples/browser/using_cdp.py+++ b/examples/browser/using_cdp.py@@ -2,11 +2,15 @@Simple demonstration of the CDP feature.To test this locally, follow these steps:-1. Create a shortcut for the executable Chrome file.-2. Add the following argument to the shortcut:- - On Windows: `--remote-debugging-port=9222`-3. Open a web browser and navigate to `http://localhost:9222/json/version` to verify that the Remote Debugging Protocol (CDP) is running.-4. Launch this example.+1. Find the chrome executable file.+2. On mac by default, the chrome is in `/Applications/Google Chrome.app/Contents/MacOS/Google Chrome`+3. Add the following argument to the shortcut:+ `--remote-debugging-port=9222`+4. Open a web browser and navigate to `http://localhost:9222/json/version` to verify that the Remote Debugging Protocol (CDP) is running.+5. Launch this example.++Full command Mac:+"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --remote-debugging-port=9222@dev You need to set the `OPENAI_API_KEY` environment variable before proceeding."""@@ -25,13 +29,7 @@ from browser_use import Agent, Toolsfrom browser_use.browser import BrowserProfile, BrowserSessionfrom browser_use.llm import ChatOpenAI-browser_session = BrowserSession(- browser_profile=BrowserProfile(- headless=False,- cdp_url='http://localhost:9222',- is_local=False,- )-)+browser_session = BrowserSession(browser_profile=BrowserProfile(cdp_url='http://localhost:9222', is_local=True))tools = Tools()