π¦ This repository is archived.
It is kept as a personal learning and experimentation project and is no longer actively developed.
Warning
Important Disclaimer
This is a personal, educational automation project created for learning and experimentation with Selenium, browser automation, and UI-driven workflows.
- This project is not affiliated with Coursera.
- It is not intended for commercial use, abuse, or large-scale automation.
- It was built in a controlled environment where access to course content was legitimately provided (e.g., institutional/college access).
Use responsibly and in accordance with all applicable terms of service.
This project started as a hands-on learning exercise.
While experimenting with Selenium, I wanted a realistic, stateful, non-trivial website to test:
- Persistent sessions
- Complex navigation flows
- Dynamic DOM updates
- Retry logic and resilience
- Long-running browser automation
Having legitimate institutional access to Coursera via my college, it became a practical sandbox to:
- Explore Selenium deeply.
- Understand how real production UIs behave.
- Build something end-to-end instead of toy scripts.
AI integration was later added purely as an experiment and documented transparently.
- A learning-focused Selenium automation system
- A personal showcase project
- A real-world example of:
- Stateful browser automation
- Modular Python scripting
- Defensive UI handling
- Optional AI-assisted workflows
- A polished product
- A guaranteed automation tool
- A bot framework
- A Coursera exploit
- Something meant to run unattended forever
The automation:
- Opens Coursera using a real Chromium browser.
- Uses a persistent Chrome profile.
- Requires manual login once.
- Navigates through:
- My Learning
- In-progress courses
- Modules and items
- Handles:
- Videos
- Mark-as-complete buttons
- Optional / completed items
- Optionally:
- Detects quizzes
- Extracts questions
- Uses AI APIs to propose answers
- Submits attempts
The emphasis is on realistic browser behavior, not stealth or speed.
- Stateful over stateless Uses a real browser profile instead of re-authenticating.
- Resilient over perfect Retry loops and fallbacks are preferred to brittle logic.
- Readable over clever Code is intentionally verbose and explicit.
- Learning-first This repo prioritizes understanding over optimization.
.
βββ script.py # Main entry point and orchestration
βββ navigate.py # Site navigation and course selection
βββ course.py # Course items, videos, completion logic
βββ quiz.py # Quiz detection + AI-assisted solving
βββ misc.py # Utilities (random delays, scrolling)
βββ debug.py # Login & session bootstrap helper
βββ requirements.txt # Python dependencies
βββ pyproject.toml # Project configuration
βββ README.md # Documentation
βββ .gitignore # Git ignore rules
βββ chromium/ # (ignored) Portable Chromium binaries
β βββ chrome.exe
β βββ chromedriver.exe
βββ chrome-profile/ # (ignored) Persistent browser session
βββ api.json # (ignored) API keys (dummy or real)
- OS: Windows 10 / 11
- Python: 3.9+
- Browser: Chromium / Chrome
- Driver: ChromeDriver (matching version)
Note: Linux/macOS are not officially supported in this repo, though the logic is portable if paths are adjusted.
Install Python dependencies using:
pip install -r requirements.txt
Key Libraries:
seleniumopenai(optional, for AI experiments)google-generativeai(optional, for AI experiments)
This project expects a portable Chromium setup to ensure environment consistency.
Directory structure:
chromium/
βββ chrome.exe
βββ chromedriver.exe
PowerShell sanity checks:
Test-Path .\chromium\chrome.exe
Test-Path .\chromium\chromedriver.exe
β οΈ Critical: ChromeDriver version must match the Chromium version.
This project does not attempt to bypass authentication.
Flow:
- Browser opens normally.
- You log in manually.
- Session data is stored in
chrome-profile/. - Future runs reuse the session cookie/profile.
This approach reduces flakiness, mimics real usage, and avoids repeated 2FA/login prompts.
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python debug.py
Log in manually when the browser opens, then close the script.
python script.py
The script will:
- Navigate to My Learning.
- Process incomplete courses.
- Return to the dashboard.
- Repeat until nothing remains.
Note: If the diagram does not render, view this README on GitHub Desktop or github.com.
graph TD
A[Start] --> B[Open Coursera]
B --> C{Login Session Exists?}
C -- No --> D[Manual Login Required]
C -- Yes --> E[Navigate to My Learning]
D -- After Login --> E
E --> F{Find Incomplete Course}
F -- None Found --> Z[End]
F -- Found --> G[Enter Course]
G --> H[Module Loop]
H --> I{Item Type?}
I -- Video --> J[Watch/Skip]
I -- Reading/Misc --> K[Mark Complete]
I -- Quiz --> L["AI Solver (Optional)"]
J --> M[Next Item]
K --> M
L --> M
M -- Item/Module pending --> H
M -- Reached Course End --> F
AI integration exists purely for experimentation.
Capabilities:
- Extract quiz questions & options.
- Normalize question text.
- Query AI APIs.
- Fill radio / checkbox / text inputs.
- Submit attempts.
Supported providers:
- OpenAI
- Google Gemini
Create api.json in the root directory:
{
"api_keys": [
{
"key": "YOUR_API_KEY",
"service": "openai",
"status": "working",
"counter": 0
}
]
}
- Multiple keys supported.
- Automatic failover logic.
- Gitignored by default for security.
View directory structure:
tree /F
Verify Python version:
python --version
Check installed packages:
pip list
Selenium sanity check (PowerShell One-Liner):
python -c "from selenium import webdriver; print('Selenium import OK')"
Error Handling:
- Retries > crashes.
- Logs > silence.
- Expect
StaleElementReferenceExceptionand DOM mutations.
Limitations:
- Highly dependent on Courseraβs specific UI classes.
- Global state is used intentionally.
- No concurrency support (Single Threaded).
- Breakage is expected over time.
MIT License Provided as-is, without warranty.
Final Note: If you clone or fork this project, expect to modify CSS selectors. Treat this as a learning artifact, not a finished product.
Happy hacking.
π¦ Repository archived
This project is preserved as a personal learning reference and is no longer under active development.