Skip to content

KernelLex/scrapperv2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”­ LeadScope β€” Ethical B2B Prospect Research Dashboard

Python Streamlit License Cost Search

Discover publicly listed B2B leads for any sector + city β€” completely free, no API keys required.


✨ What Is LeadScope?

LeadScope is a Streamlit dashboard that searches public data sources to find potential B2B prospects β€” wedding photographers, makeup artists, fitness coaches, real estate agents, and any other local sector β€” and turns them into a structured, tagged, exportable lead table.

Everything is based on publicly available information. No Instagram scraping, no private APIs, no shady data sources.


πŸ†“ 100% Free β€” No API Keys Needed

LeadScope uses DuckDuckGo as its default search engine.

Search Backend Cost API Key Required? How to Enable
DuckDuckGo (default) Free ❌ No Works out of the box
SerpAPI Free tier (100/mo) βœ… Yes β€” sign up Paste key in sidebar
Google Custom Search Free tier (100/day) βœ… Yes β€” get key Paste key + CX in sidebar

Just install and run β€” no accounts, no credit cards, no setup beyond Python.


πŸ–₯️ Screenshots

Dashboard Tagging
Dark glassmorphism UI with metrics and sortable lead table Tag leads Hot/Warm/Skip with notes, export to CSV

πŸš€ Quick Start

Prerequisites

  • Python 3.10 or higher
  • Git (for cloning)

1 β€” Clone the repository

git clone https://github.com/KernelLex/scrapperv2.git
cd scrapperv2

2 β€” Create a virtual environment

# Windows
python -m venv .venv
.venv\Scripts\activate

# macOS / Linux
python -m venv .venv
source .venv/bin/activate

3 β€” Install dependencies

pip install -r requirements.txt

4 β€” (Optional) Configure API keys

copy .env.example .env    # Windows
cp .env.example .env      # macOS / Linux

Edit .env if you want to boost your quota with SerpAPI or Google CSE. Leave it blank to use DuckDuckGo for free.

5 β€” Run the app

streamlit run app.py

Open http://localhost:8501 in your browser. That's it! πŸŽ‰


🎯 How to Use

  1. Enter a City β€” e.g. Bangalore, Mumbai, Delhi
  2. Enter a Sector β€” e.g. wedding photographers, bridal makeup artists, fitness coaches
  3. Adjust Filters (optional):
    • Max results
    • Must have Instagram
    • Must have phone or email
    • Weak digital presence only
    • Follower range (for Instagram leads)
    • Fetch landing pages (richer data, slower)
  4. Click πŸš€ Find Leads
  5. Browse the Results tab β€” sort by Quality Score or DP Score
  6. Switch to 🏷️ Tag Leads β€” mark prospects as Hot / Warm / Skip
  7. Export CSV anytime for your CRM or outreach tool

πŸ—‚οΈ Project Structure

scrapperv2/
β”œβ”€β”€ app.py          # Streamlit dashboard β€” UI, pipeline orchestration, tabs
β”œβ”€β”€ search.py       # Search backends: DuckDuckGo (free), SerpAPI, Google CSE
β”œβ”€β”€ extractor.py    # BeautifulSoup page fetch + phone/email/Instagram extraction
β”œβ”€β”€ scoring.py      # Digital presence score + lead quality score + filters
β”œβ”€β”€ database.py     # SQLite: sessions + leads (upsert, tag, delete)
β”œβ”€β”€ utils.py        # Rate limiter, dedup fingerprint, phone/email/URL helpers
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .env.example    # Copy to .env β€” all keys are optional
└── README.md

βš™οΈ Pipeline β€” How It Works

[Sidebar Input]
  city + sector + filters
        β”‚
        β–Ό
[search.py]  run_searches()
  β€” 8 varied query templates per search run
  β€” Auto-selects: SerpAPI β†’ Google CSE β†’ DuckDuckGo (free)
  β€” Rate limited (1.5 s between DuckDuckGo calls)
        β”‚
        β–Ό
[extractor.py]  extract_leads()
  β€” Regex parse of snippet: phones, emails, Instagram URLs
  β€” Optional: fetch landing page with requests + BeautifulSoup
  β€” Heuristic name extraction from page title
        β”‚
        β–Ό
[utils.py]  deduplicate_leads()
  β€” MD5 fingerprint on name + city + instagram_url
        β”‚
        β–Ό
[scoring.py]  score_leads()  β†’  apply_filters()
  β€” digital_presence_score (higher = weaker online presence)
  β€” lead_quality_score (higher = more contact info)
        β”‚
        β–Ό
[database.py]  save_leads()
  β€” SQLite upsert β€” INSERT OR IGNORE by fingerprint
  β€” Session tracking
        β”‚
        β–Ό
[app.py]  Results tab
  β€” Sortable, paginated dataframe with clickable links
  β€” 4 summary metric cards
  β€” Score distribution charts
  β€” CSV export
  β€” Tagging workflow (Hot / Warm / Skip + notes)

πŸ“Š Scoring System

Digital Presence (DP) Score β€” higher = weaker online presence = better opportunity

Signal Points
No website found +3
Only Linktree / bio link page +2
Simple page-builder website (Wix, Carrd, etc.) +2
WhatsApp-only contact (no email) +1
No email AND no phone +2
Strong professional website + full contact info βˆ’5

Lead Quality Score β€” higher = more actionable lead

Signal Points
Has Instagram URL +2
Has phone / WhatsApp +2
Has email +2
Has website +1
Has both phone AND email +3 (bonus)
DP score β‰₯ 5 (weak presence = sales opportunity) +2 (bonus)
No contact info at all βˆ’1

Interpretation

DP Score Meaning
7+ Very weak online presence β€” prime opportunity
4–6 Some gaps β€” could benefit from services
0–3 Reasonably established digital presence
Quality Score Meaning
8+ Excellent β€” multiple contact channels
4–7 Good β€” some contact info available
0–3 Limited β€” minimal actionable data

πŸ› οΈ Configuration Reference

All settings are optional. Copy .env.example to .env and edit:

# Option A β€” SerpAPI (100 free searches/month)
SERPAPI_KEY=your_key_here

# Option B β€” Google Custom Search Engine
GCSE_API_KEY=your_google_api_key
GCSE_CX=your_search_engine_id

# Phone number parsing region (default: India)
DEFAULT_PHONE_REGION=IN

# SQLite database path
DB_PATH=leads.db

πŸ”§ Troubleshooting

Problem Solution
Zero results from DuckDuckGo DDG may be rate-limiting β€” wait 30 s and retry
duckduckgo_search import error Run pip install duckduckgo-search
Slow with "Fetch landing pages" Toggle it off for faster (shallower) results
Phone numbers not found Check DEFAULT_PHONE_REGION in .env
Duplicate leads appearing They're deduplicated by fingerprint; re-run clears cache
Streamlit won't start Ensure you're in the venv: .venv\Scripts\activate

🀝 Ethical Use

  • βœ… Only publicly listed information is collected
  • βœ… No Instagram private API, no account login, no scraping of follower lists
  • βœ… Polite rate-limiting between all HTTP requests
  • βœ… Intended for manual, personalised B2B outreach β€” not bulk spam
  • βœ… Respects the spirit of robots.txt β€” only reads publicly served HTML

πŸ“¦ Tech Stack

Technology Purpose
Streamlit Dashboard UI
ddgs Free DuckDuckGo search (no key)
requests HTTP client for page fetching
BeautifulSoup4 HTML parsing
pandas Data manipulation & CSV export
phonenumbers Phone number parsing
validators URL & email validation
SQLite3 Local persistent storage
python-dotenv Environment config

πŸ“„ License

MIT License β€” free for personal and commercial use.


Made with ❀️ for ethical B2B prospecting  ·  github.com/KernelLex/scrapperv2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages