Skip to content
gopsthvPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Python Data Collection & Analysis

Web scraping and data-structuring project that extracts product information from e-commerce pages and turns it into an analysis-ready dataset.

📌 Overview

This project builds a Python-based data collection pipeline that scrapes product listings (starting with Amazon) and structures the extracted fields — price, ratings, reviews, availability, brand — into a clean, tabular dataset ready for downstream analysis.

🎯 Objective

  • Extract product-level data directly from live web pages rather than relying on an existing dataset
  • Handle real-world HTML inconsistencies (missing fields, inconsistent formatting, pagination)
  • Convert unstructured page content into a structured dataset that can be analyzed like any other tabular data source

🛠️ Tools & Libraries

Tool Purpose
Python Core scripting language
Requests Sending HTTP requests and handling page responses
BeautifulSoup Parsing HTML and locating target elements
Pandas Structuring scraped data into DataFrames and exporting to CSV
Regular Expressions (re) Cleaning inconsistent text — prices, ratings, currency symbols

📂 Notebooks in this repo

  • Python Web Scraping.ipynb — Core scraping workflow: sends requests to product pages, parses HTML with BeautifulSoup, and extracts product name, price, rating, and availability.
  • amazon web scaraping.ipynb — Amazon-specific scraping pass, extracting product identifiers, brand, and review counts from Amazon listing pages.
  • Amazon multi.ipynb — Extends the scraping workflow across multiple product pages/categories in a single run, looping through a list of URLs and consolidating results into one dataset.

Note: Data Cleaning.ipynb and Exploratory_Data_Analysis.ipynb in this repo are general practice notebooks and aren't part of the scraping workflow above.

⚙️ Approach

  1. Request handling — Sent structured GET requests to target product pages, with error handling for failed or blocked requests.
  2. HTML parsing — Used BeautifulSoup to locate and extract specific tags/classes containing product name, price, rating, and review count.
  3. Text cleaning — Applied regular expressions to strip currency symbols, normalize rating formats (e.g., "4.5 out of 5 stars" → 4.5), and handle missing fields gracefully.
  4. Multi-page scraping — Looped the extraction logic across multiple product URLs/categories to build a larger combined dataset.
  5. Structuring & export — Loaded all extracted records into a Pandas DataFrame and exported to CSV for further analysis.

🔑 Key Skills Demonstrated

  • Practical web scraping on real (not sandboxed) HTML structure
  • Data cleaning at the point of collection, not after the fact
  • Writing reusable scraping logic that works across multiple pages/categories
  • Turning unstructured web content into a structured, analysis-ready dataset

🚀 How to Run

  1. Clone this repo
  2. Install dependencies: pip install requests beautifulsoup4 pandas
  3. Open the desired notebook in Jupyter and run all cells
  4. Scraped output is saved as a CSV in the working directory

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages