End-to-end bid participation automation for the Government e-Marketplace of India.
From login and captcha solving to document upload and OTP verification β fully automated.
Features β’ Installation β’ Quick Start β’ Configuration β’ Architecture β’ Contributing
GeM BidPlus Automation handles the entire bid participation workflow on bidplus.gem.gov.in so you don't have to click through it manually.
- π Smart Login β Captcha OCR via Tesseract with manual fallback, OTP auto-fetch from email (IMAP)
- π Bid Search β Exact bid search and one-click participation
- π Catalogue Offering β Automatic catalogue selection, encrypt & save
- π° Offer Price β Price entry, estimated price modal handling, encrypt & save
- π Document Upload β Bulk upload mapped by document field keys with flexible file resolution
- π¦ EMD/EPBG β Navigate and save
- β Bid Verification β Consent checkbox, OTP verification (auto-fetch or manual)
- π§ Smart Flow Detection β Reads the sidebar progress indicator to resume from the current step
- π‘οΈ Anti-Detection β Patchright (Playwright fork) with human-like delays, typing, scrolling, and mouse movement
| Dependency | Purpose |
|---|---|
| Python 3.11+ | Runtime |
| Google Chrome | Browser (stable channel) |
| Tesseract OCR | Captcha recognition |
# Ubuntu / Debian sudo apt install tesseract-ocr # macOS brew install tesseract # Windows β https://github.com/UB-Mannheim/tesseract/wikigit clone https://github.com/FlacSy/gem-automation.git cd gem-automation python -m venv .venv source .venv/bin/activate # Linux/macOS # .venv\Scripts\activate # Windows pip install -r requirements.txt patchright install chromiumcp .env.example .env # Edit .env with your GeM login, password, and (optionally) email for OTPpython main.pyThe script will:
- Open Chrome and navigate to GeM BidPlus
- Log in (captcha β password β OTP)
- Search for the specified bid and click Participate
- Run through all bid participation steps automatically
- Wait for you to press Enter before closing the browser
GEM_DEBUG=1 python main.pyEnables verbose logging and saves artifacts (HAR, traces, screenshots) to debug_logs/artifacts/.
| Variable | Required | Description |
|---|---|---|
GEM_LOGIN | No* | GeM login ID |
GEM_PASSWORD | No* | GeM password |
GEM_SEARCH_BID | No* | Bid number for exact search |
GEM_EMAIL_IMAP_HOST | No | IMAP server (default: imap.gmail.com) |
GEM_EMAIL_USER | No | Email for OTP retrieval |
GEM_EMAIL_PASSWORD | No | IMAP app password |
GEM_EMAIL_USE_SSL | No | Use SSL for IMAP (1 / 0) |
GEM_UPLOAD_DOCUMENTS_DIR | No | Directory with documents to upload |
GEM_UPLOAD_DOC_<KEY> | No | Path to a specific document by field key |
GEM_DEBUG | No | Enable debug mode (1 / 0) |
GEM_VERIFY_OTP | No | Pre-set OTP for bid verification |
* Prompted interactively in the console if not set.
All CSS selectors, timeouts, delays, and flow-specific settings live in config.yaml. You rarely need to modify this file unless the GeM portal changes its markup.
The upload flow maps document fields (defined in config.yaml β upload_documents.document_fields) to files on disk. Resolution order:
- Environment variable β
GEM_UPLOAD_DOC_<KEY>(e.g.GEM_UPLOAD_DOC_EXPERIENCE_CRITERIA=/path/to/file.pdf) - Directory scan β matching filename from
GEM_UPLOAD_DOCUMENTS_DIR(seedocument_filename_by_keyin config) - Fallback β
GEM_UPLOAD_DOCUMENT_FILE
gem-automation/ βββ main.py # Entry point βββ config.yaml # Selectors, timeouts, delays βββ logger.py # Logging (file + console in DEBUG) βββ browser/ β βββ stealth_browser.py # Patchright Chrome launch β βββ humanization.py # Human-like interactions βββ flows/ β βββ base.py # BaseFlow ABC β βββ flow_detector.py # Bid participation state detection β βββ login.py # Login flow β βββ search.py # Search & participate β βββ catalogue.py # Catalogue offering β βββ offer_price.py # Offer price β βββ upload_documents.py # Document upload β βββ emd_epbg.py # EMD/EPBG β βββ verify_bid.py # Verify bid with OTP βββ utils/ βββ config.py # YAML + Pydantic config loader βββ email_client.py # IMAP OTP fetcher Login β Search β [ Flow Detector ] β Catalogue β Offer Price β Upload Docs β EMD/EPBG β Verify Bid β | βββββββββββββββββ re-detect after each step ββββββββββββββββββββ The Flow Detector reads the sidebar (ul.progress-indicator) to determine which step is current and which are already completed, so the automation always resumes from the right place.
This tool is provided for educational and research purposes. Use it responsibly and in compliance with GeM's terms of service. The authors are not responsible for any misuse or consequences arising from the use of this software.
Contributions are welcome! See CONTRIBUTING.md for guidelines.
- Fork the repository
- Create your feature branch
- Commit your changes
- Open a Pull Request
Please open an Issue for bugs or feature requests.
This project is licensed under the MIT License β see LICENSE for details.
Developed with β€οΈ by FlacSy