How oumansour1024/mubawab-scraper works
This is a Python/Selenium scraper for Mubawab real-estate listings. The main workflow is CLI selection, city URL construction, paginated listing extraction, detail enrichment, SQLite persistence, and flat-file export. A separate city-discovery workflow collects footer city links for later scraping. The graph reflects sampled orchestration and scraper code plus SOURCE INDEX references; some parser and retry internals were not excerpted, so their uncertain wiring is omitted.
Main entry points: orchestrator.py Listing orchestrator · orchestratior_ville.py City discovery orchestrator · search.py Paginated search · detail.py Detail enrichment
Components 24
Entry and configuration
- Scraper CLI
src/mubawab_scraper/cli.py - Settings
src/mubawab_scraper/config.py - Logging
src/mubawab_scraper/logging_config.py
Collection
- Listing orchestrator
src/mubawab_scraper/pipeline/orchestrator.py - City discovery orchestrator
src/mubawab_scraper/pipeline/orchestratior_ville.py - Search URL builder
src/mubawab_scraper/utils/urls.py - Chrome driver
src/mubawab_scraper/browser/driver.py - Page waits
src/mubawab_scraper/browser/waits.py - Paginated search
src/mubawab_scraper/scrapers/search.py - Detail enrichment
src/mubawab_scraper/scrapers/detail.py - City link discovery
src/mubawab_scraper/scrapers/search_ville_url.py - Rate limiting
src/mubawab_scraper/utils/rate_limit.py - Retry helper
src/mubawab_scraper/utils/retry.py
Parsing and models
- Listing card parser
src/mubawab_scraper/parsers/card_parser.py - Pagination parser
src/mubawab_scraper/parsers/pagination_parser.py - Listing detail parser
src/mubawab_scraper/parsers/detail_parser.py - List parser
src/mubawab_scraper/parsers/list_parser.py - Parser helpers
src/mubawab_scraper/parsers/helpers.py - Listing and city models
src/mubawab_scraper/models.py
Persistence and export
- SQLite store
src/mubawab_scraper/storage/sqlite_store.py - Flat-file export
src/mubawab_scraper/storage/csv_store.py
Other components
- Operator
- Mubawab website
- Analytics consumers
Connections 34
- Operator → Scraper CLI: runs commands
src/mubawab_scraper/cli.py - Scraper CLI → Listing orchestrator: starts scraping
src/mubawab_scraper/cli.py - Scraper CLI → City discovery orchestrator: discovers cities
src/mubawab_scraper/cli.py - Scraper CLI → Settings: reads defaults
src/mubawab_scraper/cli.py - Listing orchestrator → Settings: reads settings
src/mubawab_scraper/pipeline/orchestrator.py - Listing orchestrator → Search URL builder: builds city URL
src/mubawab_scraper/pipeline/orchestrator.py - Listing orchestrator → Chrome driver: opens browser
src/mubawab_scraper/pipeline/orchestrator.py - Listing orchestrator → Paginated search: scrapes pages
src/mubawab_scraper/pipeline/orchestrator.py - Listing orchestrator → Detail enrichment: enriches listings
src/mubawab_scraper/pipeline/orchestrator.py - Listing orchestrator → SQLite store: loads listings
src/mubawab_scraper/pipeline/orchestrator.py - Listing orchestrator → Flat-file export: exports records
src/mubawab_scraper/pipeline/orchestrator.py - Listing orchestrator → Logging: logs progress
src/mubawab_scraper/pipeline/orchestrator.py - City discovery orchestrator → Search URL builder: builds search URL
src/mubawab_scraper/pipeline/orchestratior_ville.py - City discovery orchestrator → Chrome driver: opens browser
src/mubawab_scraper/pipeline/orchestratior_ville.py - City discovery orchestrator → City link discovery: collects city links
src/mubawab_scraper/pipeline/orchestratior_ville.py - City discovery orchestrator → SQLite store: saves cities
src/mubawab_scraper/pipeline/orchestratior_ville.py - City discovery orchestrator → Flat-file export: exports cities
src/mubawab_scraper/pipeline/orchestratior_ville.py - Paginated search → Mubawab website: fetches listing pages
src/mubawab_scraper/scrapers/search.py - Paginated search → Page waits: waits for results
src/mubawab_scraper/scrapers/search.py - Paginated search → Listing card parser: parses cards
src/mubawab_scraper/scrapers/search.py - Paginated search → Pagination parser: reads pagination
src/mubawab_scraper/scrapers/search.py - Paginated search → Rate limiting: pauses between pages
src/mubawab_scraper/scrapers/search.py - Detail enrichment → Mubawab website: fetches listing details
src/mubawab_scraper/scrapers/detail.py - Detail enrichment → Page waits: waits for details
src/mubawab_scraper/scrapers/detail.py - Detail enrichment → Listing detail parser: parses details
src/mubawab_scraper/scrapers/detail.py - Detail enrichment → Rate limiting: limits requests
src/mubawab_scraper/scrapers/detail.py - Detail enrichment → Retry helper: retries failures
src/mubawab_scraper/scrapers/detail.py - City link discovery → Mubawab website: fetches city links
src/mubawab_scraper/scrapers/search_ville_url.py - City link discovery → Page waits: waits for footer
src/mubawab_scraper/scrapers/search_ville_url.py - City link discovery → Listing and city models: creates city records
src/mubawab_scraper/scrapers/search_ville_url.py - Listing card parser → Parser helpers: uses helpers
src/mubawab_scraper/parsers/card_parser.py - SQLite store → Listing and city models: stores city records
src/mubawab_scraper/storage/sqlite_store.py - SQLite store → Flat-file export: provides query data
- Analytics consumers → Flat-file export: consumes exports
README.md