A Python script that monitors the price of a specific Amazon product and sends an email alert when the price meets or drops below a specified threshold.
- Amazon Product Scraper β Fetches product title and price using
requests
andBeautifulSoup
. - Robust HTML Parsing β Multiple fallback selectors for title and price extraction.
- Price Monitoring β Runs on an infinite loop with a configurable delay between checks.
- Email Notifications β Sends alerts when the target price condition is met.
- Logging & Debugging β Logs key actions and errors for troubleshooting.
amazon_price_tracker/ β βββ tracker.py # Main script βββ response.html # Saved HTML response (for debugging) βββ README.md # Project documentation
- Python 3.7+
- The following Python packages:
pip install requests beautifulsoup4
- Fetch the Amazon page.
- Extract the product name and price.
- Compare it to your threshold.
- Send you an email if the price meets your condition.
- Wait 2 hours before checking again.
Logs are printed to the console. HTML responses are saved to response.html for inspection when parsing fails.
2025-08-12 21:00:00 - INFO - Response status code: 200 2025-08-12 21:00:00 - INFO - Found title: Sony WH-1000XM4 Wireless Headphones 2025-08-12 21:00:00 - INFO - Found price: $179.99 2025-08-12 21:00:00 - INFO - Price drop detected! Email sent, stopping monitoring.