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
added browser-use + playwright example
Saurav Panda52c768207cc9
diff --git a/examples/integrations/playwright_browser_use_shared_cdp.py b/examples/integrations/playwright_browser_use_shared_cdp.pyindex f62377b87..a43dcd7c7 100644--- a/examples/integrations/playwright_browser_use_shared_cdp.py+++ b/examples/integrations/playwright_browser_use_shared_cdp.py@@ -161,9 +161,9 @@ async def connect_playwright_to_cdp(cdp_url: str):playwright_browser = await playwright.chromium.connect_over_cdp(cdp_url)# Get or create a page- if playwright_browser.contexts and playwright_browser.contexts[0].pages:+ if playwright_browser and playwright_browser.contexts and playwright_browser.contexts[0].pages:playwright_page = playwright_browser.contexts[0].pages[0]- else:+ elif playwright_browser:context = await playwright_browser.new_context()playwright_page = await context.new_page()