Skip to content

Latest commit

Β 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’³ Credit Card Scraper with CrewAI + Gemini Flash 2.0

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.


πŸ“ Project Structure

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

πŸš€ Features

  • πŸ” 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

βš™οΈ Setup Instructions

1. πŸ—οΈ Get Your Gemini API Key

  • Go to Google AI Studio
  • Create or log into your account
  • Generate an API key
  • Copy the key and add it to your .env file in the root directory:
GEMINI_API_KEY=your_key_here

2. πŸ’» Clone the Repository

git clone https://github.com/AnurupaK/Credit-Card-Scrape-Agent.git
cd Credit-Card-Scrape-Agent

3. 🐍 Set Up Python Virtual Environment

python -m venv venv
# Activate on Windows:
venv\Scripts\activate
# Or on macOS/Linux:
source venv/bin/activate

4. πŸ“¦ Install Dependencies

pip install -r requirements.txt

Make sure you have Google Chrome and the appropriate ChromeDriver installed and accessible in your PATH.


5. πŸ”§ Run the Application

python run.py

Then open your browser and navigate to:

http://localhost:5000

🌐 Supported Websites

Currently supports scraping from:


🧠 How It Works

  1. Selenium automates visiting each credit card URL and collects the outerHTML.
  2. This raw HTML is passed to Gemini Flash 2.0 via CrewAI agent for interpretation.
  3. The agent returns a JSON structure representing credit card data.
  4. The data is cleaned using regex-based preprocessing.
  5. The frontend allows users to trigger and visualize scraping results.

πŸ› οΈ How to Use the App

The web app provides an interactive interface to control and monitor the scraping process.

πŸ”˜ UI Components

  • 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 scraping
    • Next: Processes the next batch
    • Download CSV: Exports current scraped data
  • Output Screen: Displays parsed credit card info
  • Status Area: Shows progress (e.g., Fetching...)

🧩 Flow of Operation

πŸ”Ή 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.

🎬 Demo

credit_card.mp4

About

A smart tool to scrape credit card data πŸ” using CrewAI + Gemini Flash 2.0 ⚑. Easily extract, view, and download structured info through a simple web app! 🌐

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages