This Python project monitors the availability of selected AMUL products on the AMUL website and notifies you via email when a product is back in stock.
Perfect for when you're trying to buy a high-demand item like protein milk, buttermilk and whey protein and it's often marked "Sold Out".
- ✅ Headless stock checker using Selenium
- ✅ Fully automated via GitHub Actions (runs every 4 hours)
- 📩 Sends email notifications when a product becomes available
- 🔁 Retries up to 3 times if the website fails to load properly
- 🔐 Uses GitHub Secrets for safe storage of credentials
- 📱 Supports multiple email recipients
amul-stock-watcher/
├── app/
│ ├── send_email.py # Email notification logic
│ ├── stock_checker.py # Stock checking logic
│ └── main.py # Main checker script
├── requirements.txt # Python dependencies
└── .github/
└── workflows/
└── stock-check.yml # GitHub Actions workflow- Selenium opens the AMUL product page.
- Enters your pincode via the popup modal.
- Waits for page update and checks for "Sold Out" alert.
- If not sold out, it sends an email alert with the product URL.
- GitHub Actions runs this script every 4 hours.
git clone https://github.com/yourusername/amul-stock-watcher.git
cd amul-stock-watcherpip install -r requirements.txt- Add a .env file (for local testing)
Create a file named
.envwith the following content:
[email protected]
GMAIL_PASS=your_16_char_app_password
[email protected],[email protected]python app/main.pyYou'll see the logs and recieve an email if the product is in stock.
Go to your repo > Settings > Secrets and variables > Actions, and add these:
| Secret Name | Description |
|---|---|
GMAIL_USER |
Your Gmail address |
GMAIL_PASS |
Your Gmail app password (16 characters) |
EMAIL_TO |
Comma-separated list of recipient emails |
Ensure your repo contains:
- app/
- send_email.py
- stock_checker.py
- main.py
- requirements.txt
- .github/
- workflows/
- stock-check.yml
- .env (optional for local testing)git add .
git commit -m "Setup AMUL Stock Watcher"
git push origin mainYou can manually trigger the workflow from the GitHub Actions tab in your repo.
The script runs every 4 hours using the following cron expression:
on:
schedule:
- cron: '0 */4 * * *'This means it will check the stock at 00:00, 04:00, 08:00, 12:00, 16:00, and 20:00 UTC.
You can specify multiple email addresses in the EMAIL_TO variable, separated by commas. The script will send notifications to all listed recipients.
- Python 3.13
- Selenium for web automation
- Gmail for email notifications
- GitHub Actions for automation
- Tested headlessly on Ubuntu 22.04 via GitHub Actions
- Make sure to use a Gmail app password for the
GMAIL_PASSvariable. Regular Gmail passwords won't work due to security restrictions. Generate one here. - If you're using a different email provider, update the SMTP server accordingly
- This project scrapes AMUL’s publicly available product stock status; use respectfully
Pull requests are welcome! Open an issue if you want to monitor multiple URLs, switch to Pushbullet/Telegram, or add logging features.