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
reuse patchright instance
Nick Sweetingf8967a12f446
diff --git a/examples/browser/stealth.py b/examples/browser/stealth.pyindex 1d48fbe63..c4e5d94ce 100644--- a/examples/browser/stealth.py+++ b/examples/browser/stealth.py@@ -22,6 +22,9 @@ terminal_width, terminal_height = shutil.get_terminal_size((80, 20))async def main():+ patchright = await async_patchright().start()++ print('\n\nNORMAL BROWSER:')# Default Playwright Chromium Browsernormal_browser_session = BrowserSession(# executable_path=<defaults to playwright builtin browser stored in ms-cache directory>,@@ -41,7 +44,7 @@ async def main():patchright_browser_session = BrowserSession(# cdp_url='wss://browser.zenrows.com?apikey=your-api-key-here&proxy_region=na',# or try anchor browser, browserless, steel.dev, browserbase, oxylabs, brightdata, etc.- playwright=await async_patchright().start(),+ playwright=patchright,user_data_dir='~/.config/browseruse/profiles/stealth',headless=False,disable_security=False,@@ -73,7 +76,6 @@ async def main():if Path('/Applications/Brave Browser.app/Contents/MacOS/Brave Browser').is_file():print('\n\nBRAVE + PATCHRIGHT STEALTH BROWSER:')- patchright = await async_patchright().start()brave_patchright_browser_session = BrowserSession(executable_path='/Applications/Brave Browser.app/Contents/MacOS/Brave Browser',playwright=patchright,