An automated scraping system that collects free course coupons from Real.discount and distributes them to specific WhatsApp groups based on course categories.
- Automated Scraping: Scrapes course coupons from Real.discount every 24 hours
- Smart Categorization: Automatically categorizes courses into specific domains
- WhatsApp Integration: Sends formatted course updates to dedicated WhatsApp groups
- Cache Management: Stores courses in JSON files by category and prevents duplicates
- Rate Limiting: Implements delays between requests and messages to avoid blocking
- Error Handling: Robust error handling and retry mechanisms for reliability
The scraper supports multiple course categories, each with its own WhatsApp group:
- Personal Development
- Cybersecurity
- Cryptocurrency
- Digital Marketing
- Backend Development
- Web Design
- Graphic Design
- Full Stack Development
- App Development
- Mobile Development
- Cloud Computing
- Quantum Computing
- SEO
- Software Development
- Artificial Intelligence
- Python 3.8 or higher
- Chrome browser installed
- Dependencies from requirements.txt
- WhatsApp Web access
- Internet connection
-
Clone the repository:
git clone <repository-url> cd couponscraper_wsap
-
Install dependencies:
pip install -r requirements.txt
-
Create a .env file with your WhatsApp group IDs:
PERSONAL_DEVELOPMENT_GROUP_ID=your_group_id CYBERSECURITY_GROUP_ID=your_group_id CRYPTO_GROUP_ID=your_group_id # Add other group IDs...
- Course categories and their keywords
- WhatsApp message templates
- Scraping intervals and delays
- Rate limiting settings
- Courses are stored in category-specific JSON files
- Located in
cache/categories/
directory - Prevents duplicate course sharing
-
Start the main script:
python main.py
-
For scheduled operation:
python schedule_daily.py
-
Initialization:
- Loads configuration and environment variables
- Sets up Chrome WebDriver
- Initializes cache system
-
Scraping Process:
- Visits Real.discount
- Applies filters (English, Free courses, Latest)
- Scrolls page to load all content
- Extracts course information
-
Processing:
- Categorizes courses based on title and description
- Checks for duplicates in cache
- Formats course information
-
Distribution:
- Groups courses by category
- Formats WhatsApp messages
- Sends to appropriate groups
- Updates cache
Each course notification includes:
- Course Title
- Original Price vs Current Price (Free)
- Course Duration
- Certification Status
- Coupon Code
- Expiration Date
- Direct Enrollment Link
- Monitor logs for errors
- Clear old cache files periodically
- Update category keywords as needed
- Check WhatsApp group IDs validity
- Check Chrome WebDriver compatibility
- Verify WhatsApp Web connection
- Monitor Real.discount website changes
- Review rate limiting settings
The system includes robust error handling for:
- Network connectivity issues
- Website structure changes
- WhatsApp connection problems
- Rate limiting and blocking
- Cache file corruption
Feel free to contribute by:
- Adding new categories
- Improving course detection
- Enhancing message formatting
- Optimizing scraping performance
- Adding new features
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is for educational purposes only. Ensure you comply with Real.discount's terms of service and WhatsApp's usage policies.