← All projects
🤖
CompletedIndependent Project · 2025

Cross-Platform Automation Bot

Selenium-powered bot for bulk WhatsApp messaging

PythonSeleniumAutomationWeb Scraping

Selenium WebDriver

Core Tech

Persistent Chrome Profile

Session Management

SQLite Tracking

Idempotency

Human-like Delays

Anti-Spam

A powerful Selenium-based automation bot designed to eliminate manual data entry and outreach. It handles inter-platform connections, data transfers, and executes bulk WhatsApp messaging workflows that previously required constant human intervention.

The problem

Coordinating data across multiple platforms and performing bulk outreach via WhatsApp required hours of mind-numbing manual work. Copy-pasting numbers and messages was not only inefficient but highly prone to human error, leading to missed contacts and duplicated messages.

The solution

I developed a headless Python automation script leveraging Selenium WebDriver. The bot automatically logs into the source platform, extracts the necessary contact and context data, formats the messages, and uses a persistent WhatsApp Web session to send out customized bulk messages automatically.

Architecture

The core is a Python script orchestrating Selenium WebDriver. It uses a SQLite database to track processed contacts (ensuring idempotency so nobody gets messaged twice). The WhatsApp module attaches to an existing Chrome user profile directory, allowing it to bypass the QR code scan on subsequent runs. Logging is handled via Python's logging module to track execution history.

Engineering Deep Dive

⚠️

Challenges Faced

WhatsApp Web is a heavily dynamic React application that frequently changes its DOM structure. Finding stable CSS selectors or XPath queries was incredibly difficult. Furthermore, sending messages too quickly triggers WhatsApp's anti-spam mechanisms, resulting in account bans.

🛠️

Techniques Used

Instead of relying on brittle absolute XPaths, I used robust relative queries and text-based locators. To circumvent anti-spam detection, I implemented randomized delays between actions and simulated human typing speeds (`ActionChains`), rather than instantly pasting text into the input fields.

Why This Technology?

Selenium was chosen over direct API usage because WhatsApp does not offer a free, open API for bulk messaging without heavy enterprise restrictions. Driving a real browser session was the only viable way to achieve this automation for a small-scale use case.

Technical deep-dive

The key to making the bot reliable was robust error handling and explicit waits (`WebDriverWait`). Network latency means elements don't always load instantly. The bot uses expected conditions to wait for specific DOM elements to become clickable before interacting. Storing the Chrome session data locally meant the bot could run unattended on a schedule without needing a human to scan a QR code every time.

What was built

Automated complex cross-platform data transfer workflows

Built a headless Selenium bot capable of navigating dynamic DOMs

Implemented robust session management to maintain WhatsApp Web logins

Added dynamic delays and human-like interactions to prevent rate-limiting/bans

Outcome

The bot successfully eliminated manual intervention for the outreach workflow, saving hours of daily administrative work. It executed campaigns consistently with zero data entry errors.