avatar
WhatsApp Web Number and Message Extractor

sara 13 22nd Aug, 2025

JavaScript 3.82 KB
Loading Please wait...
Description

Description: A JavaScript snippet for WhatsApp Web that scrolls through chats, extracts contact numbers and last messages, removes spaces, optionally strips prefixes (e.g. +91), and exports results to CSV. Script can stop automatically when a specific number is found or manually by pressing Enter. Keywords: whatsapp extractor, whatsapp number scraper, export whatsapp contacts, whatsapp web to csv, remove prefix ⚙️ Settings (edit at the top of script) STOP_NUMBER → number to stop on (after cleaning). REMOVE_PREFIX → set "+91" to strip prefix, or "" to keep full numbers. MAX_RESULTS → maximum numbers to extract. IDLE_LIMIT → how many times list stops updating before quitting. SCROLL_STEP / SCAN_DELAY_MS → control scrolling speed. 🛠 How to Use Open WhatsApp Web in your browser. Press F12 → go to Console. Paste the script → press Enter. Script auto-scrolls and collects numbers & last messages. Stops when: Target number found (STOP_NUMBER), or Enter key pressed, or Idle limit/max reached. A CSV file (whatsapp_contacts.csv) is auto-downloaded. Numbers are saved as text → no scientific notation in Excel. Messages are quoted and Excel-safe.

To share this paste please copy this url and send to your friends