Home About Skills Projects Experience Certifications Contact
G
W
T
L
N
R
F

πŸ›’ Amazon Product Web Scraper

A web scraping script built with Python, BeautifulSoup, and Requests to extract detailed product information from Amazon product pages and save it into a CSV file for analysis.

Project Details

πŸš€ Project Overview

This project is a web scraping script built with Python, BeautifulSoup, and Requests to extract detailed product information from Amazon product pages. The goal is to automate product data collection (title, price, ratings, reviews, description, and features) and save it into a CSV file for further analysis.

This scraper can be used by shoppers, data analysts, or businesses to:

  • Track price changes over time πŸ“‰πŸ“ˆ
  • Compare competing products πŸ”
  • Collect structured data for market research πŸ“Š

πŸ”§ Tech Stack & Libraries

Python 🐍 Requests πŸ“‘ BeautifulSoup 🍲 Time ⏳ CSV πŸ“‘

πŸ“₯ Data Extraction Workflow

Send Request to Amazon

A User-Agent header is added to mimic a browser and avoid being blocked.

The script checks the HTTP status code and handles cases like 403 (Blocked) or 503 (Server unavailable) gracefully.

Parse HTML with BeautifulSoup

Extracts multiple product details such as:

  • βœ… Product Title (id="productTitle")
  • βœ… Product Price (class="a-price-whole")
  • βœ… Product Rating (id="acrPopover")
  • βœ… About this Product (a-unordered-list a-vertical a-spacing-mini)
  • βœ… Product Description (id="productDescription")
  • βœ… Customer Reviews (id="cm-cr-dp-review-list")

Data Validation

If an element is not found, the script prints a warning with debugging tips (e.g., "Inspect the HTML manually").

Save Results in CSV

Extracted product details are written into a CSV file (amazon_airpod_pro_max.csv) for structured storage.

Columns include:

  • product_title
  • product_price
  • product_rate
  • product_info
  • product_description
  • product_review

πŸ“Š Example Use Case

For the Apple AirPods Pro Max product page, the script extracts:

  • Title β†’ Apple AirPods Pro Max with Active Noise Cancellation 🎧
  • Price β†’ β‚Ή59,900
  • Rating β†’ 4.5 out of 5 stars ⭐
  • Features β†’ "Active Noise Cancellation, Transparency Mode, Personalized Spatial Audio…"
  • Description β†’ Long product description from Amazon
  • Reviews β†’ Recent customer feedback

πŸ“Œ Key Learnings

  • βœ”οΈ How to send safe requests with headers & delays
  • βœ”οΈ How to parse structured & unstructured data from HTML
  • βœ”οΈ Best practices for handling missing elements in scraping
  • βœ”οΈ Writing clean datasets into CSV format for further analysis

⚠️ Important Notes

  • Amazon actively blocks scraping. Always respect robots.txt and Terms of Service.
  • For production usage, consider Selenium, Proxies, or Rotating User-Agents to handle dynamic content and prevent blocking.

🌟 Why This Project Matters

This project demonstrates real-world data collection & automation skills that can be applied in:

  • E-commerce Analytics
  • Price Monitoring Systems
  • Competitor Benchmarking
  • Customer Sentiment Analysis

It's a solid foundation for data-driven decision-making in retail and marketing.

πŸ‘¨β€πŸ’» Author

Developed by Abdelrahman Haroun

πŸ‘‰ If you like this project, give it a ⭐ on GitHub!