Intelligent Web Form Automation with LLM Reasoning
AutoFormFiller is a Python-based automation tool that uses Selenium for browser control and LLM-assisted reasoning (Gemma 9B via Groq) to complete web forms intelligently.
Unlike traditional rule-based form fillers, AutoFormFiller:
- 🔍 Dynamically extracts form fields from the DOM
- 🧠 Uses LLM reasoning to map fields to structured user data
- 🎯 Makes intelligent decisions about which buttons/links to click ("Next", "Submit", etc.)
- 👤 Falls back to human-in-the-loop when validation or edge cases occur
Initially designed for repetitive application forms, AutoFormFiller can be adapted to other structured forms with minimal configuration changes.
- ✅ Dynamic field extraction (text inputs, dropdowns, radio buttons, checkboxes)
- 🧠 LLM-powered reasoning for intelligent field mapping
- 🎯 Smart navigation (automatically selects appropriate action buttons)
- 👤 Human-in-the-loop fallback for validation errors or ambiguous cases
- 📦 Simple, maintainable codebase (core functionality in just 2 files)
- 🔧 Configurable user profiles using Pydantic models
- 🌐 Cross-platform support (Windows, macOS, Linux)
flowchart TD
A[🚀 Start Browser] --> B[🔍 Scrape Form Fields via Selenium]
B --> C[📦 Chunk Fields into Groups]
C --> D[🧠 Agent 1: LLM Field Mapping]
D --> E[✍️ Populate Fields in Browser]
E --> F[🎯 Agent 2: LLM Button Selection]
F --> G{✅ Validation?}
G -->|Pass| H[➡️ Proceed to Next Page]
G -->|Fail| I[👤 Escalate to Human Input]
H --> B
I --> J[🔄 Manual Correction]
J --> F
- Agent 1 → Maps form input fields to structured user data using LLM reasoning
- Agent 2 → Intelligently chooses the most appropriate button/action to continue
- Human Operator → Only involved when validation fails or form logic is unclear
- Python 3.9+
- Chrome Browser (for Selenium WebDriver)
- Groq API Key (free tier available)
- Clone the repository
git clone https://github.com/RohanDisa/autoformfiller.git
cd autoformfiller- Install dependencies
pip install -r requirements.txt- Configure API key
In
core.py, replace the placeholder with your actual Groq API key:
GroqProvider(api_key="your_groq_api_key_here")- Set up ChromeDriver The tool uses Chrome WebDriver. Make sure you have Chrome browser installed. The WebDriver will be managed automatically by Selenium.
Run the main script:
python main.py- 🚀 Launches a Chrome browser instance
- 🌐 Navigates to the target form URL
- 🔍 Dynamically extracts all form inputs
- 🧠 Uses LLM to intelligently fill fields with your data
- 🎯 Automatically selects appropriate action buttons
- 🔄 Repeats until form completion or human intervention needed
Modify the StudentDetails model in core.py to match your specific use case and data structure.
Your personal data is defined using a Pydantic model (StudentDetails). Here's the expected JSON schema:
{
"first_name": "John",
"middle_name": "Michael",
"last_name": "Doe",
"phone_number": "555-123-4567",
"address": "123 Main Street",
"citizenship": "United States",
"sex": "Male",
"gender": "Male",
"email": "john.doe@example.com",
"confirmed_email": "john.doe@example.com",
"password": "SecurePassword123!",
"zipcode": "12345",
"city": "New York",
"state": "NY",
"street": "123 Main Street",
"birth_month": "01",
"birth_day": "15",
"birth_year": "1990",
"degree": "Bachelor of Science",
"major": "Computer Science",
"ethnicity": "Other",
"undergrad_college": "University of Example"
}- Text inputs (name, email, address, etc.)
- Select dropdowns (state, country, degree type, etc.)
- Radio buttons (gender, citizenship status, etc.)
- Checkboxes (agreements, preferences, etc.)
- Date fields (birth date, graduation date, etc.)
autoformfiller/
├── 📄 core.py # WebDriver setup, LLM configuration, Pydantic models
├── 📄 main.py # Main orchestration logic, agent coordination
├── 📄 requirements.txt # Python dependencies
├── 📄 README.md # This file
- Model: Gemma 9B (via Groq)
- Temperature: Configurable for response creativity
- Max Tokens: Adjustable based on form complexity
- Headless Mode: Can be enabled for server deployments
- Window Size: Configurable for different screen sizes
- Timeout Settings: Adjustable wait times for page loads