An intelligent, Python-based Stock Tracking System that automates the process of monitoring product availability on e-commerce websites. The system sends real-time notifications via Telegram when the stock status of a tracked product changes.
- Automatic Stock Status Detection: Dynamically identifies stock status elements on e-commerce websites using keyword matching and machine learning.
- Real-Time Notifications: Sends instant alerts via Telegram when stock status changes.
- Multi-Site Support: Works across multiple e-commerce platforms by adapting to different website structures.
- Machine Learning Integration: Uses a Random Forest Classifier to improve stock status prediction accuracy.
- User-Friendly Interface: A clean and responsive web interface built with Flask.
- QR Code Integration: Easily connect to the Telegram bot using a QR code.
- Database Support: Stores user data, product URLs, and tracking history in an SQLite database.
- Scalable and Customizable: Well-documented code for easy customization and deployment on cloud platforms like Heroku, AWS, and Google Cloud.
- User Input: The user enters the product URL in the web interface.
- HTML Scraping: Selenium opens the product page and retrieves the HTML content.
- Stock Status Detection: BeautifulSoup parses the HTML, and the machine learning model predicts the stock status.
- Notification Sending: If the stock status changes, a notification is sent to the user via Telegram.
- Database Update: The stock status is updated in the SQLite database.
- Python: Primary programming language
- Flask: Web framework for the user interface
- Selenium: Browser automation for web scraping
- BeautifulSoup: HTML parsing library
- Scikit-learn: Machine learning library for stock status prediction
- SQLite: Lightweight database for storing user data and product information
- Telegram API: Sends real-time notifications to users
- QR Code Generation: Simplifies Telegram bot setup
-
Clone the repository:
git clone https://github.com/your-username/stock-tracking-system.git cd stock-tracking-system -
Install the required dependencies:
pip install -r requirements.txt
-
Set up your Telegram bot:
- Create a bot using BotFather and get the bot token
- Replace the
TELEGRAM_BOT_TOKENandTELEGRAM_CHAT_IDinapp.pywith your bot token and chat ID
-
Run the application:
python app.py
-
Open your browser and navigate to
http://127.0.0.1:5000to access the web interface.
- Add Product URL: Enter the product URL in the web interface and click "Start Tracking."
- Track Stock Status: The system will periodically check the stock status and send notifications via Telegram.
- QR Code Setup: Scan the QR code to connect to the Telegram bot and receive notifications.
- Support for More E-commerce Platforms: Add site-specific rules for additional websites.
- Advanced Machine Learning Models: Improve accuracy with more complex models and larger datasets.
- Multi-User Support: Allow multiple users to track products with individual accounts.
- Integration with Other Messaging Platforms: Add support for WhatsApp, Slack, or email notifications.
- Mobile App Development: Create a mobile app for easier access and tracking.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or feedback, feel free to reach out:
- Email: nisacayir@icloud.com
- GitHub: https://github.com/nisacayir
- LinkedIn: https://linkedin.com/in/nisacayir