Logo Lanfrica

Yanmife-source/Price-Comparison-Bot

Domaine:

socioeconomic

Type de record:

softwaretools
Créateur:
Yan
Hôte:
A Telegram bot that scrapes Jumia, Konga and Jiji concurrently to find the cheapest product prices in Nigeria using Playwright and Llama 4 # Price Comparison Bot 🤖 A Telegram bot that autonomously scrapes Jumia, Konga, and Jiji in parallel and uses an LLM to find you the cheapest price for any product in Nigeria. ## How it works 1. User sends `/start` in Telegram 2. Clicks the **Search Product** button 3. Types a product name (e.g. `crocs`, `iphone 14`, `standing fan`) 4. The bot concurrently scrapes all three platforms using Playwright 5. Raw scraped data is passed to Llama 4 via Groq API 6. The LLM extracts prices, compares them, and returns the cheapest option ## Tech Stack - **python-telegram-bot** — Telegram bot framework - **Playwright** — headless browser scraping with JavaScript rendering - **LangChain + Groq** — LLM pipeline using Llama 4 Scout - **asyncio TaskGroup** — concurrent scraping across all three platforms simultaneously ## Project Structure Price-Comparison-Bot/ ├── darkseid.py # Telegram bot handlers and conversation flow ├── scraper_agent.py # Playwright scraper + LangChain analysis pipeline ├── .env.example # Environment variable template ├── requirements.txt # Python dependencies └── README.md ## Setup **1. Clone the repo** ```bash git clone github.com cd Price-Comparison-Bot ``` **2. Install dependencies** ```bash pip install -r requirements.txt playwright install chromium ``` **3. Set up environment variables** ```bash cp .env.example .env ``` Then edit `.env` and add your actual keys: - `GROQ_API_KEY` — from console.groq.com - `DARKSEID_API_TOKEN` — from @BotFather on Telegram **4. Run the bot** ```bash python darkseid.py ``` Or run the scraper directly from the CLI: ```bash python scraper_agent.py "standing fan" ``` ## Usage | Command | Description | |---|---| | `/start` | Launch the bot and show the search button | | `/cancel` | Cancel an active search | ## Notes - Chromium must be installed on your system. On Arch/CachyOS: `sudo pacman -S chromium` - Scraping takes 15–30 seconds per searc …