Skip to content

Scraping Amazon product details in Python using BeautifulSoup library which makes it easy to extract web data.

Notifications You must be signed in to change notification settings

farihaNaqvi/Amazon-Scraping-With-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Amazon Scraping With Python

A Python-based web scraping project that extracts product details from Amazon search result pages and saves them into a CSV file for further analysis.

⚠️ This project is for educational purposes only.


πŸ“Œ Features

  • Scrapes Amazon search result pages
  • Extracts:
    • Product URL
    • Product title
    • Price
    • Rating
    • Number of reviews
    • ASIN
    • Product description
  • Saves structured data into a CSV file
  • Supports scraping multiple URLs using an input file

πŸ›  Tech Stack

  • Python
  • Requests
  • BeautifulSoup (bs4)
  • CSV module

πŸ“‚ Project Structure

Amazon-Scraping-With-Python
β”‚
β”œβ”€β”€ amazon_scraping.py # Main scraping script
β”œβ”€β”€ url.txt # Input file containing Amazon search URLs
└── out.csv # Output file with scraped product data

▢️ How It Works

  1. Reads Amazon search URLs from url.txt
  2. Sends HTTP requests with browser-like headers
  3. Parses HTML using BeautifulSoup
  4. Extracts product-level information
  5. Writes the extracted data into out.csv

πŸš€ How to Run

1️⃣ Install Dependencies

pip install requests beautifulsoup4 lxml

2️⃣ Add URLs

Add Amazon search URLs (one per line) inside:

url.txt

3️⃣ Run the Script

python amazon_scraping.py

4️⃣ Output

Scraped data will be saved to:

out.csv

πŸ“„ Sample Output Columns

  • Product Url

  • Product Title

  • Price

  • Rating

  • Number of Review

  • ASIN

  • Product Description

⚠️ Disclaimer

  • Amazon may block requests if scraping is excessive

  • Use delays responsibly (time.sleep)

  • Follow Amazon’s Terms of Service

πŸ‘€ Author

Built as a Python automation and web scraping practice project to understand real-world data extraction workflows.

About

Scraping Amazon product details in Python using BeautifulSoup library which makes it easy to extract web data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages