Browser Use (AI Agent) Integration

Browser Use is an AI-powered browser automation framework that enables AI agents to control browsers using natural language commands. Connect it to Scrapfly Cloud Browser for scalable AI-driven automation with built-in proxies and fingerprinting.

Beta Feature: Cloud Browser is currently in beta.

What is Browser Use?

Browser Use is an open-source Python framework that combines Large Language Models (LLMs) with browser automation. Instead of writing explicit automation code, you give the AI agent natural language instructions like "find product prices" or "fill out this form", and the agent figures out how to accomplish the task using browser interactions.

AI-Powered

Uses LLMs to understand tasks and interact with websites intelligently. No hardcoded selectors needed.

Natural Language

Describe tasks in plain English. The AI agent translates your intent into browser actions.

Self-Adapting

Handles dynamic page structures and adapts to changes without updating code.

Installation

Install Browser Use using pip (requires Python 3.11+):

Browser Use uses Playwright under the hood for browser control. When connecting to Cloud Browser, Playwright connects via CDP (Chrome DevTools Protocol) to remote browser instances.

Quick Start

Connect Browser Use to Cloud Browser and run AI-powered tasks:

Data Extraction with AI

Use Browser Use to extract structured data from websites using natural language instructions:

Task Automation

Automate complex multi-step workflows with natural language:

Session Persistence

Maintain browser state across AI agent runs using the session parameter:

Proxy Options

Proxy Pool Use Case Cost
datacenter General AI automation, high speed, lower cost 1 credits/30s + 2 credits/MB
residential Protected sites, geo-targeting, anti-bot bypass 1 credits/30s + 10 credits/MB

Best Practices

  • Be specific with tasks - Clear, detailed instructions help the AI agent succeed
  • Use structured outputs - Ask the agent to return data in specific formats (JSON, lists, etc.)
  • Handle failures gracefully - Wrap agent runs in try/catch and provide fallback logic
  • Monitor costs - AI agents may take longer than traditional automation. Always close browser sessions when done.
  • Use sessions wisely - Reuse sessions for multi-step workflows to maintain state
  • Choose the right LLM - More capable models (GPT-4) perform better but cost more. Test with different models.
  • Test tasks iteratively - Start with simple tasks and gradually increase complexity

WebSocket URL Format

Cloud Browser WebSocket URLs support the following parameters:

Parameter Description Required
api_key Your Scrapfly API key Yes
proxy_pool Proxy pool: datacenter or residential No (default: datacenter)
os Operating system: linux, windows, macos No (default: linux)
session Session ID for persistent browser state No

Example URL:

Summary