Behatsdaa-stores-list

Behatsdaa Scraper Suite & Data Pipeline πŸ’³πŸŽπŸ·οΈ

Live Web Application: https://elonuziel.github.io/Behatsdaa-site-ai-mesh/
Frontend Web Repository: elonuziel/Behatsdaa-site-ai-mesh

An automated data extraction suite, anti-bot bypass pipeline, and data normalization engine for the Behatsdaa club catalog:

  1. Rechargeable Card Stores: All stores, chains, restaurants, fashion brands, and attractions participating in Behatsdaa recharge cards (Club Cards, Fighter Card, Restaurants, Carrefour, Online Grocery, etc.).
  2. Rotating Deals, Coupons & Vouchers: Dedicated consumer goods (holiday specials, electronics, home goods), attraction tickets, and food vouchers that rotate weekly/monthly.
  3. Statement Discounts (Χ”Χ Χ—Χ•Χͺ Χ‘ΧžΧ’ΧžΧ“ Χ”Χ—Χ™Χ•Χ‘): Over 10,600 local businesses, shops, and services granting automatic statement discounts when paying with a Behatsdaa credit card (Max), powered by Be-Plus.

πŸ”„ Two-Repository Architecture & Automated Sync

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Behatsdaa-stores-list (This Repository)               β”‚
β”‚  - Python 3.10+ & Playwright scraping suite            β”‚
β”‚  - Imperva Incapsula WAF & anti-bot bypass             β”‚
β”‚  - Normalizes & exports verified data/ (*.json, *.csv) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚  git push (data/** changes)
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  πŸ€– GitHub Action (.github/workflows/sync-data.yml)    β”‚
β”‚  - Automatically copies data/ to Behatsdaa-site-ai-mesh β”‚
β”‚  - Commits & pushes with SYNC_DATA_PAT                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚  triggers deploy workflow
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Behatsdaa-site-ai-mesh (Production Web App)           β”‚
β”‚  - Vite + Tailwind CSS + MiniSearch                    β”‚
β”‚  - Card & Table views across all 3 tabs                β”‚
β”‚  - Automated GitHub Pages build & deployment           β”‚
β”‚  πŸ‘‰ https://elonuziel.github.io/Behatsdaa-site-ai-mesh/ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

When you update data locally and push to main in this repository:

git add data/
git commit -m "chore(data): refresh catalog"
git push origin main

The GitHub Action automatically syncs the datasets into Behatsdaa-site-ai-mesh, which rebuilds and deploys the live site.


πŸ“ Repository Structure

Behatsdaa-stores-list/
β”œβ”€β”€ scraper.py                 # Unified Playwright scraper for cards & rotating deals
β”œβ”€β”€ scrape_beplus.py           # High-speed API scraper for Be-Plus billing discounts (10,600+ stores)
β”œβ”€β”€ extract_behatsdaa_deals.js # In-browser JS extractor for logged-in sessions (1,700+ deals)
β”œβ”€β”€ requirements.txt           # Python dependencies (playwright, requests, etc.)
β”œβ”€β”€ data/                      # Master production datasets (JSON & Excel CSV)
β”‚   β”œβ”€β”€ stores.json            # 980+ store chains across 8 rechargeable wallets
β”‚   β”œβ”€β”€ stores.csv             # Excel-compatible stores CSV
β”‚   β”œβ”€β”€ deals.json             # 1,730+ rotating deals, vouchers & holiday specials
β”‚   β”œβ”€β”€ deals.csv              # Excel-compatible deals CSV
β”‚   β”œβ”€β”€ billing_stores.json    # 10,600+ Be-Plus statement discounts
β”‚   └── billing_stores.csv     # Excel-compatible billing discounts CSV
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ test_scraper.py        # Unit tests for Behatsdaa scraper logic & normalization
β”‚   β”œβ”€β”€ test_scrape_beplus.py  # Unit tests for Be-Plus scraper & CRM API mapping
β”‚   └── test_data_integrity.py # Schema validation & cross-linking integrity tests
β”œβ”€β”€ .github/workflows/
β”‚   └── sync-data.yml          # Automated sync workflow pushing data/ to site repo
└── README.md                  # Documentation and scraper usage guide

πŸ› οΈ Scraper Usage & Data Extraction

[!NOTE] Why Scraping is Executed Locally / On-Demand:

Three extraction workflows are supported:


The simplest and most reliable method to capture the live catalog directly from your standard browser (Chrome, Edge, Brave). Because it runs inside your existing authenticated session, it requires zero browser setup or GUI in WSL and bypasses all Imperva WAF / Cloudflare protections instantly.

[!TIP] WSL Users & Downloads Folder: Files downloaded from Chrome/Edge in Windows land in your Windows Downloads folder, which is directly accessible in WSL at:

/mnt/c/Users/<YourWindowsUsername>/Downloads/cards_raw.json
/mnt/c/Users/<YourWindowsUsername>/Downloads/deals_raw.json

The interactive menu (./scraper.py) automatically searches /mnt/c/Users/*/Downloads/ so you can just press Enter!

A. Extract Rechargeable Cards (extract_behatsdaa_cards.js):

  1. Log into behatsdaa.org.il.
  2. Press F12 $\rightarrow$ Console.
  3. Paste extract_behatsdaa_cards.js and press Enter to download cards_raw.json.
  4. Import directly into the catalog:
    python3 scraper.py --import-cards /mnt/c/Users/<YourUsername>/Downloads/cards_raw.json
    

B. Extract Deals & Vouchers (extract_behatsdaa_deals.js):

  1. Log into behatsdaa.org.il.
  2. Press F12 $\rightarrow$ Console.
  3. Paste extract_behatsdaa_deals.js and press Enter to download deals_raw.json.
  4. Import directly into the catalog:
    python3 scraper.py --import-deals /mnt/c/Users/<YourUsername>/Downloads/deals_raw.json
    

Method 2: Automated Python Scraper (scraper.py) & Interactive Menu πŸ€–

Launch the interactive CLI menu:

./scraper.py

(Or pass --menu)

==============================================================
        πŸ’³ Behatsdaa - Scraper & Data Pipeline Suite
==============================================================
 Select an action to perform:

  [1] πŸ’³ Scrape Rechargeable Cards (Playwright headless - terminal login)
  [2] 🎁 Scrape Rotating Deals (Playwright headless - terminal login)
  [3] πŸš€ Full Scrape: Cards + Deals (Playwright headless - terminal login)
  [4] πŸ–₯️  Manual Browser Scrape (Playwright headful - enter in browser window)
  [5] 🏷️  Scrape Be-Plus Billing Discounts (10,600+ stores, no browser)
  [6] πŸ“₯ Import Cards from file (cards_raw.json)
  [7] πŸ“₯ Import Deals from file (deals_raw.json)
  [8] πŸ”§ Check & Install Requirements (Playwright & Chromium)
  [0] ❌ Exit
==============================================================

Automated Requirement Detection & Auto-Install:

Login Modes Supported:

  1. Automated Terminal Login (--headless): Prompts for your Israeli ID (or reads --id) and the SMS OTP verification code directly in your terminal, enters them automatically, and saves cookies to ./behatsdaa_profile.
  2. Classic Manual Browser Login (--manual-login or Option 4): Opens a visible Chrome/Edge browser window on screen, allows you to enter your ID and SMS code directly in the browser GUI, and resumes once you press Enter in the terminal.

Method 3: Be-Plus Scraper for Statement Discounts (scrape_beplus.py) πŸ’³

A standalone, high-performance scraper for the Be-Plus network (10,600+ participating businesses giving direct statement discounts on Behatsdaa credit cards):

# Run the complete Be-Plus scraper across all 445 pages (10,600+ businesses):
python scrape_beplus.py --output-dir data

# Run a quick test on the first 3 pages:
python scrape_beplus.py --max-pages 3

πŸ§ͺ Running Automated Tests

Run the full Python test suite to verify scrapers, data parsers, and dataset schema integrity:

python -m unittest discover tests

πŸ“„ License & Attribution

Created for the benefit of Israeli reserve soldiers (Miluim) and Behatsdaa club beneficiaries. Brand names, logos, and terms are property of Behatsdaa and Be-Plus.