Skip to content

Warchlik/forms_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

forms_bot

A Python bot that automatically fills out Google Forms using Selenium. Built as a university project to explore browser automation.


How it works

The bot opens a Chromium instance in incognito mode and fills out a form multiple times. For each run, it opens a new tab, randomly picks answers from a predefined pool, submits the form, and closes the tab — keeping memory usage low.

Randomizing answers from a pool makes the responses look more natural and avoids identical submissions.


Stack

  • Python 3.13
  • Selenium — browser automation
  • Chromium + ChromeDriver — headless-ready browser
  • uv — Python package manager

Project structure

forms_bot/
├── src/
│   ├── main.py
│   └── config.py
└── README.md

Configuration

Answers are defined in src/config.py as a dictionary where each key is a question number and each value is a list of possible XPath selectors to randomly pick from.

CONFIG_ALL: dict[int, list[str] | list[list[str]]] = {
    # Single choice — bot randomly picks one answer
    1: [
        "//span[contains(text(), 'Option A')]",
        "//span[contains(text(), 'Option B')]",
    ],
    # Multiple choice — inner list, bot clicks all of them
    7: [
        [
            "//span[contains(text(), 'Option A')]",
            "//span[contains(text(), 'Option B')]",
        ]
    ],
}

Usage

# Install dependencies
uv sync

# Run
uv run python -m src.main

Or directly in code:

forms = Forms(
    form_link="https://docs.google.com/forms/...",
    driver_path="/usr/bin/chromedriver",
    times=100,
)
forms.run()

Requirements

  • Arch Linux: sudo pacman -S chromium (includes ChromeDriver at /usr/bin/chromedriver)
  • Other distros: install ChromeDriver matching your Chrome/Chromium version

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages