Automated E-Way Bill Extension Tool for Indian GST Portal
A Python-based Selenium automation script that streamlines the process of extending E-Way Bills that are expiring today on the official ewaybillgst.gov.in portal. Perfect for businesses and logistics professionals who need to manage multiple E-Way Bill extensions efficiently.
This automation script handles the tedious process of extending E-Way Bills by:
- ๐ Automatic Login: Uses your saved credentials to log into the GST portal
- ๐ Smart Filtering: Identifies E-Way Bills expiring today from your CSV data
- ๐ Vehicle Detection: Automatically scrapes current vehicle details from print pages
- ๐ Bulk Extension: Processes multiple E-Way Bills in sequence
- ๐ Detailed Logging: Tracks success/failure with comprehensive logs
โ ๏ธ Manual CAPTCHA: Pauses for user to complete CAPTCHA verification
- Filters E-Way Bills by expiration date (today's date)
- Extracts vehicle numbers and kilometers from existing records
- Handles form filling with validation and error recovery
- Early morning detection (00:00-08:00) uses previous day's date
- Recommended execution window: 08:00-16:00 for optimal performance
- Multiple retry mechanisms for network issues
- Comprehensive logging system with 4 different log levels
- Graceful handling of missing data and timeouts
- Debug logs: Complete execution trace
- Error logs: Issues and exceptions only
- Operations logs: High-level progress tracking
- Results log: Simple success/failure summary
# Clone or download the script
git clone <your-repository-url>
cd extendEwayBill-automation
# Install required packages
pip install pandas selenium beautifulsoup4# Download and install Firefox browser
# Download geckodriver from: https://github.com/mozilla/geckodriver/releases
# Add geckodriver to your system PATHCreate two essential files in the script directory:
{
"user_name": "your_username",
"password": "your_password"
}EWB.No,Valid Untill,From Place,To Place,Document No
12345678901,28/05/2025,Mumbai,Delhi,DOC001
12345678902,28/05/2025,Chennai,Bangalore,DOC002
python extendEwayBill.py| File | Purpose | Format |
|---|---|---|
user.json |
Login credentials | JSON with user_name and password |
eway.csv |
E-Way Bill data | CSV with columns: EWB.No, Valid Untill, etc. |
| File | Purpose | When to Share |
|---|---|---|
logs/debug_TIMESTAMP.log |
Complete execution trace | ๐ง Send to support for debugging |
logs/errors_TIMESTAMP.log |
Errors and exceptions only | ๐ง Send to support if issues occur |
logs/operations_TIMESTAMP.log |
High-level progress | ๐ For your review |
log.txt |
Simple success/failure results | ๐ Quick reference |
eway.txt |
E-Way Bill and vehicle mapping | ๐ Vehicle tracking |
pip install pandas>=1.3.0
pip install selenium>=4.0.0
pip install beautifulsoup4>=4.9.0-
Install Firefox Browser (latest version recommended)
-
Download GeckoDriver:
- Visit: https://github.com/mozilla/geckodriver/releases
- Download version matching your OS
- Extract to a folder in your system PATH
-
Verify Installation:
geckodriver --version
Your eway.csv must include these columns:
| Column | Example | Required |
|---|---|---|
EWB.No |
12345678901 |
โ Yes |
Valid Untill |
28/05/2025 |
โ Yes |
From Place |
Mumbai |
โ Optional |
To Place |
Delhi |
โ Optional |
Document No |
DOC001 |
โ Optional |
Date Format: DD/MM/YYYY (e.g., 28/05/2025)
- Browser Type: Firefox (non-headless by default)
- Window: Maximized for better visibility
- Session: Maintains login across multiple operations
The script DOES NOT solve CAPTCHAs automatically. Here's what happens:
- Script pauses at login screen when CAPTCHA appears
- You manually complete the CAPTCHA
- Script automatically continues once login is successful
- No manual intervention needed after successful login
๐ก Tip: Keep the browser window visible during execution to handle any unexpected CAPTCHAs.
-
๐ Login Phase
- Script navigates to ewaybillgst.gov.in
- Enters your credentials from
user.json - PAUSES for CAPTCHA (you complete manually)
- Continues automatically after successful login
-
๐ Data Collection Phase
- Reads E-Way Bills from
eway.csv - Filters bills expiring today
- Visits print pages to extract vehicle details
- Saves vehicle information for extensions
- Reads E-Way Bills from
-
๐ Extension Phase
- Processes each E-Way Bill individually
- Fills extension forms with collected data
- Submits requests and monitors results
- Logs success/failure for each bill
-
๐ Completion
- Generates comprehensive logs
- Creates summary report
- Provides troubleshooting information
- โฐ Best Time: 08:00 AM - 4:00 PM
- ๐ Early Morning: Uses previous day's date (00:00-08:00)
- ๐ Daily Run: Execute once per day for expiring bills
extendEwayBill.py
โโโ ๐ Logging Configuration (Lines 1-100)
โโโ ๐ง Utility Functions (Lines 101-200)
โโโ ๐ Login Management (Lines 201-350)
โโโ ๐ Vehicle Data Extraction (Lines 351-450)
โโโ ๐ Extension Processing (Lines 451-600)
โโโ ๐ Main Execution (Lines 601-700)
| Component | Purpose | Entry Point |
|---|---|---|
extendEwayBill |
Main automation class | __init__() |
fresh_login() |
Handles login with CSRF protection | Called before major operations |
getPrintEwayAndFindCurrentVehicle() |
Extracts vehicle details | Called in Step 1 |
extendEwayBills() |
Processes extensions | Called in Step 2 |
- ๐ Data Extraction: Modify
getPrintEwayAndFindCurrentVehicle() - ๐ Form Handling: Update
extend_single_eway() - ๐ Logging: Use existing decorators
@log_function_callor@log_selenium_action - ๐ก๏ธ Error Handling: Follow existing try-catch patterns
- ๐ Debug Logs: Check
logs/debug_TIMESTAMP.logfor detailed execution - ๐ URL Tracking: Script logs all page navigation
- ๐ Element Detection: Uses explicit waits for reliable element interaction
- ๐ Retry Logic: Most operations have 5-attempt retry mechanisms
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Follow coding standards: Use existing logging patterns
- Test thoroughly: Verify with sample data
- Submit pull request: Include detailed description
- ๐ Logging: Use decorators for function entry/exit tracking
- ๐ก๏ธ Error Handling: Implement retry logic for network operations
- ๐ Documentation: Add docstrings for new functions
- ๐งช Testing: Test with various CSV formats and scenarios
- ๐ง Enhanced Error Recovery: Improve handling of network failures
- ๐จ UI Improvements: Better progress indication
- ๐ Reporting: Enhanced success/failure analytics
- ๐ Browser Support: Add Chrome/Edge compatibility
- ๐ฑ Notifications: Email/SMS alerts for completion
- Never commit
user.jsonwith real credentials to version control - Use environment variables for production deployments
- Regularly update passwords and review access logs
- Authorized Use Only: Use only with your own GST credentials
- Rate Limiting: Script includes delays to avoid overwhelming servers
- Terms of Service: Ensure compliance with GST portal's terms of use
- Data Protection: Handle E-Way Bill data according to your privacy policies
- CAPTCHA Manual: Cannot solve CAPTCHAs automatically
- Network Dependent: Requires stable internet connection
- Portal Changes: May need updates if GST portal changes structure
- Browser Specific: Currently supports Firefox only
- ๐ Bug Reports: Include debug logs and detailed steps to reproduce
- ๐ก Feature Requests: Describe use case and expected behavior
- โ Questions: Check logs first, then contact with specific error messages
- ๐ Login: 30-60 seconds (including CAPTCHA)
- ๐ Vehicle Data: 15-30 seconds per E-Way Bill
- ๐ Extension: 20-40 seconds per E-Way Bill
- ๐ Total: ~1-2 minutes per E-Way Bill
- ๐พ Memory: ~100-200 MB during execution
- ๐ Network: Moderate (respects server rate limits)
- ๐พ Disk: Minimal (logs and result files)
python selenium automation gst eway-bill indian-government logistics firefox web-scraping business-automation tax-compliance bulk-processing data-extraction form-automation transportation
Created by Shubham Malik | Version 1.0 | Last Updated: May 2025
"Always committed to the development of Transport and Logistics Infrastructure to speed up the supply chain and help the country grow."
Shubham Malik is dedicated to building automation solutions that streamline India's logistics ecosystem, reduce bureaucratic delays, and empower businesses to focus on growth rather than paperwork. This tool represents a commitment to:
- ๐ฎ๐ณ National Growth: Supporting India's economic development through efficient logistics
- โก Supply Chain Acceleration: Reducing manual processing time from hours to minutes
- ๐ข Business Empowerment: Enabling small and large enterprises to manage compliance effortlessly
- ๐ฌ Continuous Innovation: Developing tools that adapt to India's evolving digital infrastructure
By automating repetitive government portal interactions, we aim to:
- ๐ Boost Productivity: Free up valuable human resources for strategic work
- ๐ Improve Accuracy: Eliminate manual errors in compliance processes
- ๐ฐ Reduce Costs: Lower operational overhead for transportation businesses
- ๐ Scale Operations: Enable businesses to handle larger volumes efficiently
IMPORTANT NOTICE: This software is provided "AS IS" without warranty of any kind. The creator, Shubham Malik, shall NOT be held liable for:
- โ Misuse of Software: Any unauthorized, illegal, or non-compliant use of this tool
- ๐ซ Portal Violations: Breach of GST portal terms of service by end users
- ๐ธ Financial Losses: Any direct or indirect financial damages resulting from software use
- ๐ Data Issues: Loss, corruption, or mishandling of user data
- ๐๏ธ Legal Consequences: Any legal action arising from improper usage
- โก System Failures: Server downtime, network issues, or technical malfunctions
By using this software, you agree to:
- ๐ Authorized Access Only: Use only your own legitimate GST credentials
- ๐ Compliance: Ensure all activities comply with Indian GST laws and regulations
- ๐ก๏ธ Security: Protect your credentials and use secure systems
- ๐ Data Accuracy: Verify all automated submissions for correctness
- โ๏ธ Legal Accountability: Accept full responsibility for all consequences of usage
- ๐ซ No Misuse: Refrain from any activities that violate portal terms or applicable laws
This tool is designed exclusively to assist legitimate business operations in:
- โ Extending valid E-Way Bills before expiration
- โ Streamlining compliance processes for authorized users
- โ Reducing manual effort in routine logistics operations
Users must NOT use this tool for:
- โ Fraudulent transactions or false documentation
- โ Accessing accounts without proper authorization
- โ Circumventing government security measures
- โ Any activity that violates GST portal terms of service
- โ Commercial misuse or unauthorized redistribution
For legitimate technical support or business inquiries:
- ๐ง Email: [Include your contact information]
- ๐ Issues: Report bugs with detailed logs and reproduction steps
- ๐ก Suggestions: Feature requests for logistics automation improvements
Note: Support is provided for legitimate use cases only. Requests related to circumventing security measures or unauthorized access will not be entertained.
This tool represents our commitment to India's digital transformation in logistics. By using it responsibly, you contribute to building a more efficient, transparent, and growth-oriented supply chain ecosystem for our nation.
Always ensure compliance with applicable laws and regulations when using automation tools with government portals.
Developed with ๐งก for Indian Transport & Logistics Industry