# rpakishore/ak_selenium architecture

> Architecture diagram of the GitHub repository rpakishore/ak_selenium, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rpakishore/ak_selenium
- Repository: https://github.com/rpakishore/ak_selenium

## Overview

##### Main Components Identification

a) Core Browser Automation Layer
- Chrome Implementation
- Firefox Implementation
- Base Browser Class
- Helium Integration

b) Request Integration Layer
- Session Management
- Anti-bot Features
- Cookie/Header Transfer

**┌─ Application Layer (User Code) ─────────────────────┐**

- ┬───────────────────┬───────────────┘

**┌─ Automation Layer ─┐    ┌─ Request Layer ──────────┐**
- Chrome         │    │  - Session Management     │
- Firefox        │    │  - Anti-bot Protection    │
- Browser Base   │    │  - Header/Cookie Transfer │
- ┬────────────┘    └──────────┬────────────────┘

**┌─ External Dependencies ──────────┴─────────────┐**
- Selenium WebDriver                          │
- Helium                                      │
- Requests Library                            │
- ┘

##### Implementation Details

a) Browser Class Hierarchy:
- Base Browser class
- Chrome implementation
- Firefox implementation

b) Integration Points:
- Helium attribute wrapper
- Session management
- Cookie/header transfer mechanism

##### Additional Elements

- Configuration options (user agent, wait times)
- Test coverage indicators

##### Notes for Scale

- The wrapper nature of the project
- Integration between Selenium and Requests
- Anti-bot features as a key differentiator

##### Technical Details

- Wait time configurations
- Session management parameters
- Browser option customizations
- Helium method mappings

Remember to maintain a balance between showing the high-level architecture and including enough detail to understand the anti-bot measures and integration points that make this project valuable.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph User["Application Layer"]
        UserCode["User Code"]
    end

    subgraph Auto["Browser Automation Layer"]
        BaseBrowser["Base Browser Class"]
        Chrome["Chrome Implementation"]
        Firefox["Firefox Implementation"]
        HeliumInt["Helium Integration"]
    end

    subgraph Req["Request Integration Layer"]
        SessionMgmt["Session Management"]
        AntiBot["Anti-bot Features"]
        HeaderTransfer["Header/Cookie Transfer"]
    end

    subgraph Ext["External Dependencies"]
        Selenium["Selenium WebDriver"]
        Helium["Helium"]
        Requests["Requests Library"]
    end

    subgraph Test["Testing Layer"]
        BrowserTests["Browser Tests"]
        RequestTests["Request Tests"]
    end

    %% Relationships
    UserCode --> BaseBrowser
    UserCode --> SessionMgmt
    
    BaseBrowser --> Chrome
    BaseBrowser --> Firefox
    BaseBrowser --> HeliumInt
    
    Chrome --> Selenium
    Firefox --> Selenium
    HeliumInt --> Helium
    
    SessionMgmt --> Requests
    SessionMgmt --> AntiBot
    SessionMgmt --> HeaderTransfer
    
    BrowserTests --> BaseBrowser
    RequestTests --> SessionMgmt

    %% Click Events
    click BaseBrowser "https://github.com/rpakishore/ak_selenium/blob/main/src/ak_selenium/browser.py"
    click Chrome "https://github.com/rpakishore/ak_selenium/blob/main/src/ak_selenium/chrome.py"
    click Firefox "https://github.com/rpakishore/ak_selenium/blob/main/src/ak_selenium/firefox.py"
    click HeliumInt "https://github.com/rpakishore/ak_selenium/blob/main/src/ak_selenium/helium_attribs.py"
    click SessionMgmt "https://github.com/rpakishore/ak_selenium/blob/main/src/ak_selenium/browser.py"
    click RequestTests "https://github.com/rpakishore/ak_selenium/blob/main/src/tests/test_requests.py"
    click BrowserTests "https://github.com/rpakishore/ak_selenium/blob/main/src/tests/test_browser.py"

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef browser fill:#dae8fc,stroke:#6c8ebf
    classDef request fill:#d5e8d4,stroke:#82b366
    classDef external fill:#fff2cc,stroke:#d6b656
    classDef test fill:#e1d5e7,stroke:#9673a6
    
    class BaseBrowser,Chrome,Firefox,HeliumInt browser
    class SessionMgmt,AntiBot,HeaderTransfer request
    class Selenium,Helium,Requests external
    class BrowserTests,RequestTests test

    %% Legend
    subgraph Legend
        Browser["Browser Components"]:::browser
        RequestComp["Request Components"]:::request
        Ext["External Dependencies"]:::external
        TestComp["Test Components"]:::test
    end
```
