A powerful web automation assistant that provides real-time browser control and task execution through an interactive web interface.
- Real-Time Browser Control: Live view of browser actions through WebSocket connection
- Interactive Console: Execute tasks directly from the web interface
- Task Queue Management: Handle multiple sequential tasks with proper queuing and execution
- Robust Error Handling: Automatic retries and recovery strategies
- Visual Feedback: Real-time status updates and browser screenshots
- Cookie Consent Handling: Automatic handling of cookie consent popups
- Extensible Architecture: Easy to add new task types and capabilities
- Python 3.8+
- Playwright
- aiohttp
- OpenCV (cv2)
- NumPy
- Pillow
- Clone the repository:
git clone https://github.com/airhick/AIwebagent.git
cd AIwebagent- Install dependencies:
pip install -r requirements.txt- Install Playwright browsers:
playwright install- Start the assistant:
python src/main.py-
Open your browser and navigate to
http://localhost:3000 -
Enter tasks in the interactive console, for example:
- "go to google"
- "search for python programming"
- "go to reddit"
.
├── src/
│ ├── main.py # Entry point
│ ├── web_assistant.py # Core assistant class
│ ├── task_executor.py # Task execution logic
│ ├── task_planner.py # Task analysis and planning
│ ├── task_queue.py # Async task queue management
│ └── element_detector.py # Visual element detection
├── browser_viewer/
│ ├── index.html # Web interface
│ └── browser_state.json # Current browser state
└── browser_screenshots/ # Screenshot storage
- WebSocket-based communication
- Live screenshot updates
- Task status monitoring
- Interactive console input
- Asynchronous task queue
- Automatic retries on failure
- Progress tracking
- Error recovery strategies
- Screenshot capture and analysis
- Element detection
- Visual state verification
- Change detection
- Automatic recovery attempts
- Detailed error logging
- Status updates
- Retry mechanisms
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Playwright for browser automation
- aiohttp for async web server
- OpenCV for visual processing