A newer version of the Gradio SDK is available:
6.5.1
metadata
title: Browser Automation Tool
emoji: π
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 4.21.0
app_file: app.py
pinned: false
Browser Automation Tool
A comprehensive browser automation platform that combines the power of Gradio for web UI and FastAPI for programmatic access. This tool enables seamless web scraping, browser automation, and integration with AI agents.
Features
- π Web Browser Automation: Control Chrome/Chromium browsers programmatically
- πΈ Screenshot Capture: Take screenshots of any webpage
- π Web Scraping: Extract data from HTML content
- π€ AI Agent Integration: Compatible with Model Context Protocol (MCP)
- β‘ Real-time Streaming: Server-Sent Events (SSE) for live updates
- π RESTful API: FastAPI backend for programmatic access
- π± Web Interface: User-friendly Gradio UI
Quick Start
Using the Web Interface
- Visit the Space URL above
- Enter a URL to navigate
- Use built-in tools for automation
Using the API
import requests
# Get available sessions
response = requests.get('https://your-space-url/api/sessions')
sessions = response.json()
# Create a new browser session
session_data = {
'headless': True,
'window_size': {'width': 1920, 'height': 1080}
}
response = requests.post('https://your-space-url/api/sessions', json=session_data)
session_id = response.json()['session_id']
# Navigate to a website
requests.post(f'https://your-space-url/api/sessions/{{session_id}}/navigate',
json={{'url': 'https://example.com'}})
# Take a screenshot
response = requests.get(f'https://your-space-url/api/sessions/{{session_id}}/screenshot')
with open('screenshot.png', 'wb') as f:
f.write(response.content)
API Endpoints
Session Management
GET /api/sessions- List all active sessionsPOST /api/sessions- Create new browser sessionDELETE /api/sessions/{{session_id}}- Close session
Browser Control
POST /api/sessions/{{session_id}}/navigate- Navigate to URLGET /api/sessions/{{session_id}}/screenshot- Take screenshotPOST /api/sessions/{{session_id}}/click- Click elementPOST /api/sessions/{{session_id}}/type- Type textGET /api/sessions/{{session_id}}/get_page_source- Get HTML
Author
MiniMax Agent - Advanced AI automation tools