# ============================================================================== # Author: Simon-Pierre Boucher # File: src/main.py (ka-fb-marketplace) # Desc: Facebook Marketplace — logements à louer (propertyrentals), Québec. # Scraping public DÉCONNECTÉ, AUCUN rendu JS : les données vivent dans # les ', re.S) def default_search_urls() -> list[str]: urls = [] for slug in BIG_CITIES: for lo, hi in PRICE_BANDS: urls.append(f"{BASE}/{slug}/propertyrentals" f"?minPrice={lo}&maxPrice={hi}" f"&sortBy=creation_time_descend") for cid in REGIONAL_CITIES: for lo, hi in REGIONAL_BANDS: urls.append(f"{BASE}/{cid}/propertyrentals" f"?minPrice={lo}&maxPrice={hi}" f"&sortBy=creation_time_descend") return urls def _iter_json_scripts(html: str): for m in _SCRIPT_RE.finditer(html): try: yield json.loads(m.group(1)) except ValueError: continue def walk_listings(html: str) -> dict: """Objets d'annonce (marketplace_listing_title) des