# skrbyrm/python-web-scraping-with-selenium architecture

> Architecture diagram of the GitHub repository skrbyrm/python-web-scraping-with-selenium, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/skrbyrm/python-web-scraping-with-selenium
- Repository: https://github.com/skrbyrm/python-web-scraping-with-selenium

## Overview

This is a Selenium-based scraper that logs into a website for each account in an Excel credential list, collects table data, filters and enriches the results, and writes them to MySQL and Excel. The main workflow and storage operations are visible in scrap.py. The README also describes the product’s capabilities; all implementation nodes share that single source file because the code is monolithic. The graph does not infer unshown website behavior or database internals.

Main entry points: [`scrap.py`](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py) (Account workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Inputs and orchestration"]
  node_workflow["Account workflow<br/>[scrap.py]"]
  node_credentials["Credential conversion<br/>[scrap.py]"]
end

subgraph group_scraping["Browser scraping"]
  node_browser["Browser setup<br/>[scrap.py]"]
  node_login["Login<br/>[scrap.py]"]
  node_navigation["Page navigation<br/>[scrap.py]"]
  node_table_scrape["Table scraping<br/>[scrap.py]"]
end

subgraph group_processing["Data processing"]
  node_transform["Filter and enrich<br/>[scrap.py]"]
end

subgraph group_storage["Persistence and updates"]
  node_sql_engine["SQL connection<br/>[scrap.py]"]
  node_checkpoint["Date checkpoint<br/>[scrap.py]"]
  node_db_write["Consumption write<br/>[scrap.py]"]
  node_procedure_update["Period updates<br/>[scrap.py]"]
  node_excel_output["Excel output<br/>[scrap.py]"]
  node_error_report["Error report<br/>[scrap.py]"]
end

node_operator(("Operator"))
node_credential_file["Credential workbook"]
node_website["Authenticated website"]
node_mysql[("MySQL database")]
node_output_files["Output workbooks"]

node_operator -->|"starts"| node_workflow
node_credential_file -->|"reads"| node_credentials
node_credentials -->|"provides accounts"| node_workflow
node_workflow -->|"initializes"| node_browser
node_workflow -->|"calls"| node_login
node_login -->|"authenticates"| node_website
node_workflow -->|"clicks"| node_navigation
node_navigation -->|"interacts"| node_website
node_workflow -->|"calls"| node_table_scrape
node_table_scrape -->|"reads table"| node_website
node_workflow -->|"checks dates"| node_checkpoint
node_checkpoint -->|"reads through"| node_sql_engine
node_sql_engine -->|"queries"| node_mysql
node_workflow -->|"filters and enriches"| node_transform
node_table_scrape -->|"returns rows"| node_workflow
node_workflow -->|"persists results"| node_db_write
node_db_write -->|"appends rows"| node_mysql
node_workflow -->|"calls procedures"| node_procedure_update
node_procedure_update -->|"updates periods"| node_mysql
node_workflow -->|"exports results"| node_excel_output
node_excel_output -->|"writes sheets"| node_output_files
node_workflow -->|"exports errors"| node_error_report
node_error_report -->|"writes sheet"| node_output_files

click node_workflow "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py"
click node_credentials "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py"
click node_browser "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py"
click node_login "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py"
click node_navigation "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py"
click node_table_scrape "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py"
click node_transform "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py"
click node_sql_engine "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py"
click node_checkpoint "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py"
click node_db_write "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py"
click node_procedure_update "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py"
click node_excel_output "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py"
click node_error_report "https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.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_workflow,node_credentials toneBlue
class node_browser,node_login,node_navigation,node_table_scrape,node_mysql toneAmber
class node_transform toneMint
class node_sql_engine,node_checkpoint,node_db_write,node_procedure_update,node_excel_output,node_error_report toneRose
class node_operator,node_credential_file,node_website,node_output_files toneIndigo
```

## Components

### Inputs and orchestration

- [Account workflow](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`
- [Credential conversion](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`

### Browser scraping

- [Browser setup](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`
- [Login](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`
- [Page navigation](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`
- [Table scraping](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`

### Data processing

- [Filter and enrich](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`

### Persistence and updates

- [SQL connection](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`
- [Date checkpoint](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`
- [Consumption write](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`
- [Period updates](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`
- [Excel output](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`
- [Error report](https://github.com/skrbyrm/python-web-scraping-with-selenium/blob/main/scrap.py): `scrap.py`

### Other components

- **Operator**
- **Credential workbook**
- **Authenticated website**
- **MySQL database**
- **Output workbooks**

## Connections

- Operator → Account workflow: starts (evidence: `scrap.py`)
- Credential workbook → Credential conversion: reads (evidence: `scrap.py`)
- Credential conversion → Account workflow: provides accounts (evidence: `scrap.py`)
- Account workflow → Browser setup: initializes (evidence: `scrap.py`)
- Account workflow → Login: calls (evidence: `scrap.py`)
- Login → Authenticated website: authenticates (evidence: `scrap.py`)
- Account workflow → Page navigation: clicks (evidence: `scrap.py`)
- Page navigation → Authenticated website: interacts (evidence: `scrap.py`)
- Account workflow → Table scraping: calls (evidence: `scrap.py`)
- Table scraping → Authenticated website: reads table (evidence: `scrap.py`)
- Account workflow → Date checkpoint: checks dates (evidence: `scrap.py`)
- Date checkpoint → SQL connection: reads through (evidence: `scrap.py`)
- SQL connection → MySQL database: queries (evidence: `scrap.py`)
- Account workflow → Filter and enrich: filters and enriches (evidence: `scrap.py`)
- Table scraping → Account workflow: returns rows (evidence: `scrap.py`)
- Account workflow → Consumption write: persists results (evidence: `scrap.py`)
- Consumption write → MySQL database: appends rows (evidence: `scrap.py`)
- Account workflow → Period updates: calls procedures (evidence: `scrap.py`)
- Period updates → MySQL database: updates periods (evidence: `scrap.py`)
- Account workflow → Excel output: exports results (evidence: `scrap.py`)
- Excel output → Output workbooks: writes sheets (evidence: `scrap.py`)
- Account workflow → Error report: exports errors (evidence: `scrap.py`)
- Error report → Output workbooks: writes sheet (evidence: `scrap.py`)
