Browser-Use
Connect Browser-Use AI web agents to Lightcone cloud browsers.
Browser-Use is an open-source framework that makes websites accessible to AI agents. Connect it to Lightcone’s cloud browsers for scalable, stealth-enabled web automation.
Install
Section titled “Install”pip install browser-use tzafon playwrightplaywright install chromiumExample
Section titled “Example”from browser_use import Agentfrom langchain_openai import ChatOpenAIfrom tzafon import Lightconefrom playwright.async_api import async_playwright
async def main(): # Create a Lightcone browser session client = Lightcone() session = client.computers.create(kind="browser") cdp_url = session.endpoints.get("cdp")
# Connect Playwright to the Lightcone browser pw = await async_playwright().start() browser = await pw.chromium.connect_over_cdp(cdp_url)
# Create a Browser-Use agent on the remote browser agent = Agent( task="Search for 'machine learning' on Wikipedia and summarize the first paragraph", llm=ChatOpenAI(model="gpt-4o"), browser=browser, )
result = await agent.run() print(result)
await browser.close() await pw.stop() client.computers.delete(session.id)
import asyncioasyncio.run(main())Why use Lightcone with Browser-Use?
Section titled “Why use Lightcone with Browser-Use?”By default, Browser-Use runs a local Chromium browser. Connecting it to Lightcone gives you:
- Cloud execution — No local browser needed; scale to many concurrent agents
- Stealth mode — Lightcone’s anti-detection features help agents access sites that block automation
- Residential proxies — Rotate IPs to avoid rate limiting
- Session persistence — Save and restore login state across agent runs
How it works
Section titled “How it works”Browser-Use uses Playwright internally. Lightcone exposes a Chrome DevTools Protocol (CDP) endpoint for each browser session. You connect Playwright to Lightcone’s CDP URL instead of launching a local browser, and Browser-Use operates on the remote session transparently.
Resources
Section titled “Resources”See also
Section titled “See also”- Playwright — direct CDP connection without Browser-Use
- Run an agent — use Lightcone’s built-in agent as an alternative
- Web scraping — scraping use cases