# metakrist/business_scraper architecture

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

- Interactive diagram: https://gitdiagram.com/metakrist/business_scraper
- Repository: https://github.com/metakrist/business_scraper

## Overview

This is a single-file Selenium business-directory scraper. Its workflow starts with a user launching the script and manually solving the CAPTCHA, then searches and paginates directory results, extracts business and registered-agent details, tracks progress, and writes CSV or JSON output. The README documents these capabilities, while the sampled source shows browser setup, CAPTCHA prompting, progress-file access, and output serialization. Some orchestration and profile-extraction code is omitted, so those documented stages are represented without asserting unshown calls.

Main entry points: [`scraper.py`](https://github.com/metakrist/business_scraper/blob/master/scraper.py) (Scraper Workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection"]
  node_scraper["Scraper Workflow<br/>[scraper.py]"]
  node_browser["Chrome Browser"]
  node_directory["Business Directory"]
  node_business_data["Business Profiles<br/>[scraper.py]"]
  node_captcha["CAPTCHA Prompt<br/>[scraper.py]"]
end

subgraph group_state["Progress State"]
  node_progress[("Resume Progress<br/>[scraper.py]")]
end

subgraph group_output["Output"]
  node_filename["Output Naming<br/>[scraper.py]"]
  node_csv["CSV Writer<br/>[scraper.py]"]
  node_json["JSON Writer<br/>[scraper.py]"]
  node_output_files["Output Files"]
end

node_user(("User"))

node_user -->|"launches"| node_scraper
node_scraper -->|"controls"| node_browser
node_scraper -->|"prompts"| node_captcha
node_user -->|"solves manually"| node_captcha
node_scraper -->|"searches and paginates"| node_directory
node_scraper -->|"extracts records"| node_business_data
node_scraper -->|"reads and writes"| node_progress
node_scraper -->|"generates name"| node_filename
node_scraper -->|"selects format"| node_csv
node_scraper -->|"selects format"| node_json
node_csv -->|"writes CSV"| node_output_files
node_json -->|"writes JSON"| node_output_files

click node_scraper "https://github.com/metakrist/business_scraper/blob/master/scraper.py"
click node_business_data "https://github.com/metakrist/business_scraper/blob/master/scraper.py"
click node_captcha "https://github.com/metakrist/business_scraper/blob/master/scraper.py"
click node_progress "https://github.com/metakrist/business_scraper/blob/master/scraper.py"
click node_filename "https://github.com/metakrist/business_scraper/blob/master/scraper.py"
click node_csv "https://github.com/metakrist/business_scraper/blob/master/scraper.py"
click node_json "https://github.com/metakrist/business_scraper/blob/master/scraper.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_scraper,node_browser,node_directory,node_business_data,node_captcha,node_user toneBlue
class node_progress toneAmber
class node_filename,node_csv,node_json,node_output_files toneMint
```

## Components

### Collection

- [Scraper Workflow](https://github.com/metakrist/business_scraper/blob/master/scraper.py): `scraper.py`
- **Chrome Browser**
- **Business Directory**
- [Business Profiles](https://github.com/metakrist/business_scraper/blob/master/scraper.py): `scraper.py`
- [CAPTCHA Prompt](https://github.com/metakrist/business_scraper/blob/master/scraper.py): `scraper.py`

### Progress State

- [Resume Progress](https://github.com/metakrist/business_scraper/blob/master/scraper.py): `scraper.py`

### Output

- [Output Naming](https://github.com/metakrist/business_scraper/blob/master/scraper.py): `scraper.py`
- [CSV Writer](https://github.com/metakrist/business_scraper/blob/master/scraper.py): `scraper.py`
- [JSON Writer](https://github.com/metakrist/business_scraper/blob/master/scraper.py): `scraper.py`
- **Output Files**

### Other components

- **User**

## Connections

- User → Scraper Workflow: launches (evidence: `README.md`)
- Scraper Workflow → Chrome Browser: controls (evidence: `scraper.py`)
- Scraper Workflow → CAPTCHA Prompt: prompts (evidence: `scraper.py`)
- User → CAPTCHA Prompt: solves manually (evidence: `README.md`)
- Scraper Workflow → Business Directory: searches and paginates (evidence: `README.md`)
- Scraper Workflow → Business Profiles: extracts records (evidence: `README.md`)
- Scraper Workflow → Resume Progress: reads and writes (evidence: `scraper.py`)
- Scraper Workflow → Output Naming: generates name (evidence: `scraper.py`)
- Scraper Workflow → CSV Writer: selects format (evidence: `scraper.py`)
- Scraper Workflow → JSON Writer: selects format (evidence: `scraper.py`)
- CSV Writer → Output Files: writes CSV (evidence: `README.md`)
- JSON Writer → Output Files: writes JSON (evidence: `README.md`)
