This repository contains a Python script that utilizes Beautiful Soup, a popular web scraping library, to extract product details from an e-commerce website. The script is designed to fetch product names, prices, and ratings, but can easily be extended to gather more information.
- Simple and modular Python script to scrape product details from a website.
- Utilizes Beautiful Soup for efficient HTML parsing and data extraction.
- Flexible and customizable for scraping various e-commerce websites.
- Lightweight and easy to use, making it accessible for developers of all levels.
- Python 3.7 or higher.
- Beautiful Soup 4 library (install using
pip install beautifulsoup4
). - Requests library (install using
pip install requests
).
-
Clone the repository to your local machine:
git clone https://github.com/lastuchiha/ecommerce-scraper.git cd ecommerce-scraper
-
Install the dependencies:
pip install -r requirements.txt
-
Run the Script:
python main.py -url <product-url>
replace the
<product-url>
with the url of the productpython main.py -f <filename>
if you have multiple products to scrape then keep the links inside a
.txt
file with urls of products in separate lines and replace the<filename>
with the name of that file.
This project and the provided script are intended for educational purposes only. The primary goal is to demonstrate web scraping techniques using Beautiful Soup and provide a learning resource for developers interested in this topic.
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.