Automates login to the GATE portal, solves arithmetic captcha (OCR with manual fallback), and writes extracted result data per candidate.
- Facade:
GateResultServiceorchestrates the complete workflow. - Strategy:
CaptchaSolverimplementations (manual,ocr,hybrid). - Factory:
CaptchaSolverFactorycreates strategy instances. - Observer: Multiple result sinks (
ConsoleResultSink,CsvResultSink) subscribe to each result. - SOLID:
- SRP: Each class has one responsibility.
- OCP/LSP: New solver/client implementations plug in via interfaces.
- ISP/DIP: Service depends on abstractions in
core/interfaces.py.
gate_automation/core/— interfaces, models, orchestrator servicegate_automation/infrastructure/— CSV loader, captcha solvers, Playwright client, sinksdata/credentials.csv— input credentialsoutput/results.csv— output data
- Python 3.10+
- Tesseract OCR binary installed on OS (required for OCR mode)
- Browser binaries for Playwright
cd /home/barath/Documents/Gate-Res
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m playwright install chromiumdata/credentials.csv
enrollment_id,password
G229J81,Manish@04Hybrid mode (OCR first, then manual input fallback):
python -m gate_automation.main --captcha-mode hybrid --headfulManual mode:
python -m gate_automation.main --captcha-mode manual --headfulOutput is appended to output/results.csv.
pytest -q- Captcha OCR is best-effort; if OCR fails, hybrid mode asks manual answer.
- Portal HTML can change; selectors in
playwright_client.pymay need occasional tuning.