This project is a smart and scalable credit card scraping tool that uses Selenium for web automation and Gemini Flash 2.0 (via Google AI) for intelligent content parsing. It leverages CrewAI agents to extract structured credit card data from web pages in a flexible, extensible architecture.
CREDIT_CARD_SCRAPER/
βββ Backend/
β βββ app.py # Flask server to serve frontend
βββ Frontend/
β βββ static/
β β βββ script.js
β β βββ style.css
β βββ templates/
β βββ index.html # Web UI
βββ GeminiCreditCardAgent/
β βββ agents.py
β βββ crew.py
β βββ tasks.py
β βββ tools.py # CrewAI logic
βββ modules/
β βββ credit_card_links.py
β βββ data_pre_process.py
β βββ scrape_format.py # scraping instruction for agent
βββ .env # Store your Gemini API key here
βββ run.py # Main entry point
βββ requirements.txt
- π Scrapes credit card listings from dynamic sites (e.g., SBI)
- π€ Uses Gemini Flash 2.0 agent for parsing content
- π§ Built with CrewAI agents and tools
- π οΈ Preprocesses scraped data with regex
- π Simple Flask-based web frontend
- π₯ Download extracted data as a CSV file
- Go to Google AI Studio
- Create or log into your account
- Generate an API key
- Copy the key and add it to your
.envfile in the root directory:
GEMINI_API_KEY=your_key_heregit clone https://github.com/AnurupaK/Credit-Card-Scrape-Agent.git
cd Credit-Card-Scrape-Agentpython -m venv venv
# Activate on Windows:
venv\Scripts\activate
# Or on macOS/Linux:
source venv/bin/activatepip install -r requirements.txtMake sure you have Google Chrome and the appropriate ChromeDriver installed and accessible in your PATH.
python run.pyThen open your browser and navigate to:
http://localhost:5000
Currently supports scraping from:
- Selenium automates visiting each credit card URL and collects the
outerHTML. - This raw HTML is passed to Gemini Flash 2.0 via CrewAI agent for interpretation.
- The agent returns a JSON structure representing credit card data.
- The data is cleaned using regex-based preprocessing.
- The frontend allows users to trigger and visualize scraping results.
The web app provides an interactive interface to control and monitor the scraping process.
- URL Box: Paste the listing page URL (e.g., SBI credit cards)
- Batch Size Box: Set number of links to process at once
- Buttons:
Start: Begins scrapingNext: Processes the next batchDownload CSV: Exports current scraped data
- Output Screen: Displays parsed credit card info
- Status Area: Shows progress (e.g.,
Fetching...)
πΉ STEP 1: Input Details
ββ π₯ Enter the **URL** of the credit card listing page
ββ π’ Specify the **Batch Size** (number of links to process at a time)
β¬οΈ
πΉ STEP 2: Start Scraping
ββ βΆοΈ Click the **"Start"** button
ββ β³ Status shows **"Fetching..."**
ββ π₯οΈ Scraped credit card data appears in the **Output Screen**
β¬οΈ
πΉ STEP 3: (Optional) Scrape More
ββ π Click the **"Next"** button to process the next batch of links
ββ β³ Status shows **"Fetching..."**
ββ β New batch of scraped data is added to the output
β¬οΈ
πΉ STEP 4: Download Data
ββ πΎ Click **"Download CSV"** to export current data
ββ π Can be done:
- After **Start**
- After any **Next**
- Or after scraping **all batches**
β
**Flexible Downloading**: You can export data anytimeβno need to wait until the end.