Apify-style Actor for scraping Facebook land and property listings in Ouagadougou (Burkina Faso). Playwright-based ETL pipeline with multi-account support.
# Facebook Foncier Scraper
Pipeline autonome pour scraper les groupes Facebook d’annonces foncières / immobilières à **Ouagadougou** (Burkina Faso).
Inspiré du modèle Actor (input clair → exécution → sortie structurée), **sans** dépendance à Apify.
## Fonctionnalités
- Mode mobile (`m.facebook.com`) + fingerprint Android stable par compte
- Extraction JSON Comet (posts mis en avant + scroll GraphQL)
- Multi-comptes (`accountId` 1–5)
- Proxy custom (résidentiel recommandé)
- Filtrage regex niveau 1 (candidats fonciers)
- Sortie JSON dans `data/processed/`
- CLI simple + fichier d’input JSON optionnel
## Structure
```text
facebook-foncier-scraper/
├── src/
│ ├── __main__.py # python -m src
│ ├── main.py # CLI / orchestration
│ ├── config.py # groupes, fingerprints, regex
│ └── scraper.py # Playwright + extraction Comet
├── groups.csv
├── input.example.json
├── pyproject.toml # deps gérées avec uv
└── requirements.txt # miroir optionnel
```
## Installation (uv)
Prérequis : uv installé.
```bash
git clone
github.com
cd facebook-foncier-scraper
# Python 3.12 (évite 3.14 : pas encore de wheels Playwright/greenlet)
uv python install 3.12
uv sync --python 3.12
# Navigateur Playwright
uv run playwright install chromium
```
> **Important :** le projet impose `requires-python = ">=3.11, Ne pas utiliser Python 3.14 pour l’instant.
## Utilisation
### Option A – arguments CLI
```bash
uv run python -m src \
--cookies-file cookies.json \
--group-limit 1 \
--days-back 1 \
--account 1 \
--proxy "
http://user:pass@host:port"
```
### Option B – fichier d’input (style Actor)
```bash
cp input.example.json input.json
# Éditer input.json (cookies, proxyUrl, groupLimit…)
uv run python -m src --input input.json
```
### Variables d’environnement (alternative)
```bash
export FB_COOKIES_JSON='[...]' # ou FB_COOKIES_JSON_1
export PROXY_URL='
http://user:pass@host:port'
uv ru …