Skip to content

Instantly share code, notes, and snippets.

View jbinfo's full-sized avatar

Lhassan Baazzi jbinfo

View GitHub Profile
@jbinfo
jbinfo / prayers_scraper.py
Created September 26, 2025 23:40
Prayer Times Scraper for Morocco - Extracts Islamic prayer times from official Ministry of Habous website (habous.gov.ma) and outputs CSV format compatible with Mawaqit App for TV. Supports multiple cities, handles Arabic text, and provides clean formatted data (Fajr, Sunrise, Dhuhr, Asr, Maghrib, Isha).
import scrapy
import csv
import re
class PrayerTimesSpider(scrapy.Spider):
name = 'prayer_times'
start_urls = [
'https://habous.gov.ma/prieres/horaire_hijri_2.php?ville=58', # Casablanca city
'https://habous.gov.ma/prieres/horaire_hijri_2.php?ville=142' # Agdz city
]