Dibya Sarothi
Dibya Sarothi
Automation & BotsProduction ReadySeptember 2026

Instagram Follower Bot

OOP Selenium Profile Discovery, Modal Handling & Lazy-Load Scroll Bot

Automates authenticated session login, modal dismissal, target account lookup, infinite follower modal scrolling, and throttled following.

Instagram Follower Bot overview
Project Overview

An object-oriented social media follower bot built with Python and Selenium WebDriver. Encapsulates authentication, recurring post-login modal dismissal, target account search, JavaScript scrollIntoView lazy-loading inside the followers dialog, and rate-limited follow actions.

Problem Statement

Modern social web apps render follower lists lazily inside nested scrollable dialogs gated by overlapping onboarding popups.

Engineering Rationale

Demonstrates handling nested scrollable overlays, button state inspection to skip already-followed users, and pacing delays.

Engineering Objectives

Structure reusable InstaFollower class methods for login, discovery, modal scrolling, and following.
Detect and dismiss 'Save Login Info' and 'Turn on Notifications' modals reliably.
Trigger infinite scrolling inside nested follower containers using execute_script(scrollIntoView).
Architecture Blueprint

System Architecture

OOP InstaFollower Selenium controller managing explicit waits, XPath discovery, and throttled interaction loops.

01

Lazy-Load Dialog Scrolling

Uses JavaScript scrollIntoView execution inside nested follower modals to load incremental user batches.

Core & Backend Implementation

  • InstaFollower class with login(), find_followers(), and follow() workflow methods.
  • State check follow_if_needed inspecting button labels prior to clicking.

Client & Interface Layer

  • Nested modal DOM automation with rate-limit sleep throttling.

Data & Schema Design

Engine / Tier: Runtime Browser Session State

Maintains authenticated cookies and visited button elements per automation run.

Core Models & Entities
TargetAccountFollowerAction

Authentication & Security Controls

Auth Model: Environment-configured credentials via python-dotenv
  • Credentials loaded exclusively from git-ignored .env files.

Engineering Challenges & Technical Decisions

Key Challenges Solved

Challenge: Follower popup container failing to load new accounts on window-level scroll.
Engineering Solution: Dispatched execute_script scrollIntoView calls directly on bottom modal child nodes.

Trade-Off Decisions

Decision: Paced Click Delays & State Checks
Architectural Rationale: Prevents duplicate unfollow toggles on already-followed users and avoids rapid-click throttling.

Testing & Verification Methodology

Frameworks & Approach: Interactive WebDriver Console Run
  • Verified modal dismissal and incremental batch follow progression.

Results & Engineering Takeaways

Mastered JS-assisted scrolling inside virtualized/lazy-loaded dialog modals.