A Python bot that automatically fills out Google Forms using Selenium. Built as a university project to explore browser automation.
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.
- Python 3.13
- Selenium — browser automation
- Chromium + ChromeDriver — headless-ready browser
- uv — Python package manager
forms_bot/
├── src/
│ ├── main.py
│ └── config.py
└── README.md
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')]",
]
],
}# Install dependencies
uv sync
# Run
uv run python -m src.mainOr directly in code:
forms = Forms(
form_link="https://docs.google.com/forms/...",
driver_path="/usr/bin/chromedriver",
times=100,
)
forms.run()- Arch Linux:
sudo pacman -S chromium(includes ChromeDriver at/usr/bin/chromedriver) - Other distros: install ChromeDriver matching your Chrome/Chromium version