# mohammadhassan-panahi/instagram-post-scraper architecture

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

- Interactive diagram: https://gitdiagram.com/mohammadhassan-panahi/instagram-post-scraper
- Repository: https://github.com/mohammadhassan-panahi/instagram-post-scraper

## Overview

InstaLink Extractor is a single-script desktop utility: the user supplies an Instagram profile URL, the script opens it in Chrome, supports manual login, handles pop-ups, repeatedly scrolls and extracts unique post/reel links, then writes them to the Desktop. The README documents these capabilities; the sampled excerpts show the principal calls and data flow, though omitted portions of main.py were not inspected.

Main entry points: [`main.py`](https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py) (Profile extractor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Extraction workflow"]
  node_cli["URL prompt<br/>[main.py]"]
  node_extractor["Profile extractor<br/>[main.py]"]
  node_popup["Popup handling<br/>[main.py]"]
  node_linkscan["Link collection<br/>[main.py]"]
  node_writer["Desktop writer<br/>[main.py]"]
end

subgraph group_runtime["Browser runtime"]
  node_browser["Chrome browser<br/>[main.py]"]
end

node_user(("User"))
node_instagram["Instagram profile"]
node_desktop["Desktop file"]

node_user -->|"provides URL"| node_cli
node_cli -->|"calls"| node_extractor
node_extractor -->|"launches"| node_browser
node_browser -->|"opens profile"| node_instagram
node_user -.->|"logs in manually"| node_browser
node_extractor -->|"handles dialogs"| node_popup
node_extractor -->|"collects links"| node_linkscan
node_linkscan -->|"reads anchors"| node_browser
node_extractor -->|"writes results"| node_writer
node_writer -->|"saves links"| node_desktop

click node_cli "https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py"
click node_extractor "https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py"
click node_popup "https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py"
click node_linkscan "https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py"
click node_writer "https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py"
click node_browser "https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py"

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_cli,node_extractor,node_popup,node_linkscan,node_writer,node_user toneBlue
class node_browser toneAmber
class node_instagram,node_desktop toneIndigo
```

## Components

### Extraction workflow

- [URL prompt](https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py): `main.py`
- [Profile extractor](https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py): `main.py`
- [Popup handling](https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py): `main.py`
- [Link collection](https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py): `main.py`
- [Desktop writer](https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py): `main.py`

### Browser runtime

- [Chrome browser](https://github.com/mohammadhassan-panahi/instagram-post-scraper/blob/main/main.py): `main.py`

### Other components

- **User**
- **Instagram profile**
- **Desktop file**

## Connections

- User → URL prompt: provides URL (evidence: `main.py`)
- URL prompt → Profile extractor: calls (evidence: `main.py`)
- Profile extractor → Chrome browser: launches (evidence: `main.py`)
- Chrome browser → Instagram profile: opens profile (evidence: `main.py`)
- User → Chrome browser: logs in manually (evidence: `README.md`)
- Profile extractor → Popup handling: handles dialogs (evidence: `main.py`)
- Profile extractor → Link collection: collects links (evidence: `main.py`)
- Link collection → Chrome browser: reads anchors (evidence: `main.py`)
- Profile extractor → Desktop writer: writes results (evidence: `main.py`)
- Desktop writer → Desktop file: saves links (evidence: `main.py`)
