Browser Use Proxy Integration
Browser Use is a Python framework that enables LLMs (GPT-4, Claude, etc.) to control a web browser autonomously. The LLM receives screenshots and page content, then decides which actions to take -- clicking, typing, navigating, and extracting information.
For Browser Use to work reliably across diverse websites, it needs clean IP addresses that bypass anti-bot protections. Without proxies, Browser Use sessions run on your local or cloud IP, which gets blocked quickly when the agent browses multiple sites or makes rapid requests.
Why Browser Use Needs Proxies
Browser Use agents are particularly susceptible to IP-based blocking because:
- **Rapid navigation**: LLM-driven agents navigate faster than typical humans, triggering behavioral rate limits.
- **Cloud deployment**: Production Browser Use agents run on cloud servers with datacenter IPs that are blocked by default on many websites.
- **Diverse targets**: A single agent task often requires visiting multiple websites (search engines, product pages, documentation), each with its own anti-bot protections.
- **Session intensity**: Browser Use creates rich interaction patterns (scrolling, clicking, typing) that generate more requests per page than simple scraping.
Proxy Configuration
Browser Use uses Playwright internally for browser control. Configure proxies through the Browser Use agent initialization:
from browser_use import Agent# Create agent with proxy configuration agent = Agent( task="Find the best flight from NYC to London for next month", llm=ChatOpenAI(model="gpt-4o"), browser_config={ "proxy": { "server": "http://gate.hexproxies.com:8080", "username": "user-country-us", "password": "your-password" } } )
result = await agent.run() ```
Sticky Sessions for Multi-Step Tasks
Browser Use agents often perform multi-step tasks that require consistent IP addresses. For example, searching for a product, comparing prices across sites, and then returning to the original site. Use sticky sessions to maintain IP consistency within a task:
import randomdef create_session_proxy(country="us"): session_id = ''.join(random.choices(string.ascii_lowercase, k=8)) return { "server": "http://gate.hexproxies.com:8080", "username": f"user-country-{country}-session-{session_id}", "password": "your-password" }
# Each agent task gets its own sticky session proxy = create_session_proxy("us") agent = Agent( task="Compare laptop prices across Amazon, Best Buy, and Newegg", llm=ChatOpenAI(model="gpt-4o"), browser_config={"proxy": proxy} ) ```
Geo-Targeted Agent Tasks
For tasks requiring location-specific results (local search, regional pricing, geo-restricted content), use Hex Proxies geo-targeting:
# Agent sees web as a UK user
uk_proxy = {
"server": "http://gate.hexproxies.com:8080",
"username": "user-country-gb",
"password": "your-password"agent = Agent( task="Find the cheapest grocery delivery in London", llm=ChatOpenAI(model="gpt-4o"), browser_config={"proxy": uk_proxy} ) ```
Production Patterns
For production Browser Use deployments, implement:
- **Proxy rotation between tasks**: Create a new sticky session for each agent task to avoid IP carryover between unrelated tasks.
2. **Bandwidth monitoring**: Browser Use agents can consume 10-50 MB per task depending on the sites visited. Monitor through the Hex Proxies dashboard.
3. **Error recovery**: If the agent encounters a blocked page, instruct the LLM to report the block so your orchestration layer can retry with a different proxy.
4. **Resource optimization**: Configure Playwright to block images and non-essential resources to reduce bandwidth consumption:
browser_config={
"proxy": proxy,
"block_resources": ["image", "stylesheet", "font"]
}Cost Estimation
Browser Use agents typically consume 10-50 MB per task. At $4.25/GB residential pricing: - Simple research tasks (3-5 pages): ~10 MB = $0.04 per task - Complex comparison tasks (10-20 pages): ~30 MB = $0.13 per task - Heavy browsing tasks (20+ pages): ~50 MB = $0.21 per task
For 1,000 agent tasks per day, expect $40-$210/day in proxy bandwidth costs.