# mohamedbary/product-scraper architecture

> Architecture diagram of the GitHub repository mohamedbary/product-scraper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohamedbary/product-scraper
- Repository: https://github.com/mohamedbary/product-scraper

## Overview

This small Python script scrapes laptop listings from three Jumia pages, extracts product fields, and writes them to a CSV file. The workflow is implemented in one file, so its stages share that source path. The excerpt shows the requests, parsing, extraction, and CSV-writing relationships directly.

Main entry points: [`WebScrabbingProject_final.py`](https://github.com/mohamedbary/product-scraper/blob/master/WebScrabbingProject_final.py) (Fetch pages), [`products.csv`](https://github.com/mohamedbary/product-scraper/blob/master/products.csv) (Product records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scraper["Scraping workflow"]
  node_fetch["Fetch pages"]
  node_parse["Parse HTML"]
  node_extract["Extract products"]
  node_write["Write CSV"]
end

node_jumia["Jumia catalog"]
node_products["Product records<br/>[products.csv]"]

node_fetch -->|"requests pages"| node_jumia
node_fetch -->|"passes responses"| node_parse
node_parse -->|"provides listings"| node_extract
node_extract -->|"passes records"| node_write
node_write -->|"writes CSV"| node_products

click node_fetch "https://github.com/mohamedbary/product-scraper/blob/master/WebScrabbingProject_final.py"
click node_parse "https://github.com/mohamedbary/product-scraper/blob/master/WebScrabbingProject_final.py"
click node_extract "https://github.com/mohamedbary/product-scraper/blob/master/WebScrabbingProject_final.py"
click node_write "https://github.com/mohamedbary/product-scraper/blob/master/WebScrabbingProject_final.py"
click node_products "https://github.com/mohamedbary/product-scraper/blob/master/products.csv"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fetch,node_parse,node_extract,node_write toneBlue
class node_jumia toneIndigo
class node_products toneTeal
```

## Components

### Scraping workflow

- [Fetch pages](https://github.com/mohamedbary/product-scraper/blob/master/WebScrabbingProject_final.py): `WebScrabbingProject_final.py`
- [Parse HTML](https://github.com/mohamedbary/product-scraper/blob/master/WebScrabbingProject_final.py): `WebScrabbingProject_final.py`
- [Extract products](https://github.com/mohamedbary/product-scraper/blob/master/WebScrabbingProject_final.py): `WebScrabbingProject_final.py`
- [Write CSV](https://github.com/mohamedbary/product-scraper/blob/master/WebScrabbingProject_final.py): `WebScrabbingProject_final.py`

### Other components

- **Jumia catalog**
- [Product records](https://github.com/mohamedbary/product-scraper/blob/master/products.csv): `products.csv`

## Connections

- Fetch pages → Jumia catalog: requests pages (evidence: `WebScrabbingProject_final.py`)
- Fetch pages → Parse HTML: passes responses (evidence: `WebScrabbingProject_final.py`)
- Parse HTML → Extract products: provides listings (evidence: `WebScrabbingProject_final.py`)
- Extract products → Write CSV: passes records (evidence: `WebScrabbingProject_final.py`)
- Write CSV → Product records: writes CSV (evidence: `WebScrabbingProject_final.py`)
