This repository contains Python-based web scraping projects designed to automate data collection from online sources. Using BeautifulSoup and requests, these projects efficiently extract and process relevant information.
The Price Drop Notifier is a web scraper that tracks product prices on eBay and sends an email alert when the price drops below a user-defined target. This tool is useful for bargain hunters looking to purchase items at the best possible price.
- β Extracts real-time price data from eBay
- β Compares price with a set target
- β Sends an email notification when the price drops
- β Secures email credentials using environment variables
The Billboard Hot 100 Fetcher scrapes the latest Billboard Hot 100 chart to keep track of trending music. It retrieves song rankings, artist names, and other relevant details, making it an excellent tool for music lovers and data analysts.
- π΅ Fetches real-time Billboard Hot 100 chart rankings
- π€ Extracts song titles & artist names
- π Useful for trend analysis & music tracking
- β‘ Fast & efficient data retrieval using BeautifulSoup
Both projects demonstrate how web scraping can be leveraged for automation, data collection, and real-time notifications. π
- Project Overview
- β¨ Features
- βοΈ Requirements
- π Variables
- π Setup
βΆοΈ Usage- π¬ Email Alert Screenshot
- π Observations
- π‘ Recommendations
- π Conclusions
This project allows users to track the price of an eBay product. If the price drops to or below a user-defined target price, the system will send an email alert. π©
- Python π: The programming language for the script.
- BeautifulSoup π΅οΈββοΈ: For web scraping and parsing the HTML content of eBay product pages.
- requests π: For making HTTP requests to fetch webpage content.
- smtplib π§: For sending email alerts.
- dotenv π: For securely managing environment variables (e.g., email credentials).
β Track eBay product prices: Monitor the price of a product from a specific eBay listing.
β Email alerts: Receive an email notification when the price drops to or below your target price.
β Secure handling of email credentials: Using environment variables to store sensitive information securely.
To use this project, you will need the following:
- Python 3.x π
- Install the required libraries:
pip install requests beautifulsoup4 python-dotenv
Variable Name | Description | Example Value |
---|---|---|
SENDER_EMAIL |
The email address used to send notifications when the price drops. Stored securely using environment variables. | youremail@example.com |
RECEIVER_EMAIL |
The email address that will receive notifications when the price drops. Stored securely using environment variables. | receiver@example.com |
PASSWORD |
The password or app-specific password for the sender email. Stored securely using environment variables. | yourpassword |
PRODUCT_URL |
The URL of the eBay product you are tracking. | https://www.ebay.com/itm/your-product-id |
TARGET_PRICE |
The target price at which you want to receive an alert. If the product price drops to or below this value, you will be notified. | 700 |
git clone https://github.com/yourusername/ebay-price-tracker.git
cd ebay-price-tracker
In the root directory of the project, create a .env
file to store your email credentials securely. Add the following details:
SENDER_EMAIL=your-email@example.com
RECEIVER_EMAIL=receiver-email@example.com
EMAIL_PASSWORD=your-email-password
In the Python script, set the PRODUCT_URL
to the eBay product URL you want to track and set your TARGET_PRICE
:
PRODUCT_URL = "https://www.ebay.com/itm/your-product-id"
TARGET_PRICE = 700 # Set your target price here
python price_tracker.py
The script will fetch the product price from the eBay page and compare it to your target price. If the price drops to or below the target, you will receive an email notification. π©
Here's a screenshot of the email alert you will receive when the price drops! ππ°

π Web Scraping: Web scraping is mainly dependent on the website structure, and any changes to eBay's page layout or class names might break the script. Itβs recommended to test the script periodically to ensure it still works as expected.
π Email Configuration: The script uses Gmail's SMTP server. If you're using Gmail, ensure you enable "Less secure apps" or create an app-specific password if 2-factor authentication is enabled.
π‘ Error Handling: The script can be enhanced by adding more comprehensive error handling, especially to manage unexpected changes in the HTML structure, network errors, or email delivery failures.
π‘ Regular Checks: Set up a task scheduler to run the script at regular intervals to ensure it checks the price periodically.
π‘ Multiple Product Support: The script can be expanded to handle multiple products, allowing users to track prices for various items at once by accepting a list of product URLs and target prices.
The eBay Price Tracker π is a simple yet powerful tool that can help users monitor product prices on eBay and be alerted when prices drop below their target. By using Python π and web scraping π΅οΈββοΈ, along with secure handling of email credentials π, this script provides an easy-to-use solution for price tracking.
β¨ Future enhancements could include additional features like supporting multiple products and improving error handling.
π Happy Tracking! π―
- π Project Overview
- π Features
- π Setup
- π― Usage
- π Observations
- π Conclusion
- π οΈ Troubleshooting
π This project scrapes the Top 10 songs from the Billboard 200 chart for a given date using web scraping techniques. It allows users to select a date or use the latest chart and saves the data to a CSV file.
βοΈ Fetch Top 10 songs from Billboard 200 π΅
βοΈ Allows users to choose a date π
βοΈ Saves data to CSV for future reference π
βοΈ Uses BeautifulSoup for web scraping π΅οΈ
βοΈ Handles missing data & errors gracefully
git clone https://github.com/yourusername/billboard-hot-10-fetcher.git
cd billboard-hot-10-fetcher
pip install requests beautifulsoup4 pandas
python billboard_hot_10.py
π
Available recent Billboard chart dates:
1. 2025-02-10
2. 2025-02-03
3. 2025-01-27
...
Enter a date (YYYY-MM-DD) or select from above (1-5), or press Enter for the latest chart: 2
π Fetching data from: https://www.billboard.com/charts/billboard-200/2025-02-03/
π΅ Billboard Hot 10 Chart for 2025-02-03 πΆ
Rank Song Title Artist
1 1 Song Name 1 Artist 1
2 2 Song Name 2 Artist 2
...
The data is automatically saved as a CSV file:
Billboard_Top_10_2025-02-03.csv
- The script successfully extracts Billboard Hot 10 songs for any given date.
- If Billboard's website changes, the scraping method may need adjustments.
- Handling incorrect or missing data ensures smooth execution.
This project demonstrates how web scraping can be used to fetch and analyze Billboard charts dynamically. By leveraging BeautifulSoup and Pandas, users can collect and save historical music trends effortlessly.
πΉ Website changed? Billboard may update its structure, so check if h3#title-of-a-story
still exists.
πΉ Blocked requests? Try using a different User-Agent
.
πΉ Wrong date format? Ensure dates are entered in YYYY-MM-DD format.
π‘ Want to Improve It? π Feel free to fork the repo, suggest enhancements, or report any issues! Contributions are welcome! π