forked from CodeForAfrica-SCRAPERS/healthtools_ke
-
Notifications
You must be signed in to change notification settings - Fork 1
/
scraper.py
56 lines (47 loc) · 2.04 KB
/
scraper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from healthtools.scrapers.doctors import DoctorsScraper
from healthtools.scrapers.foreign_doctors import ForeignDoctorsScraper
from healthtools.scrapers.clinical_officers import ClinicalOfficersScraper
from healthtools.scrapers.health_facilities import HealthFacilitiesScraper
from healthtools.scrapers.nhif_inpatient import NhifInpatientScraper
from healthtools.scrapers.nhif_outpatient import NhifOutpatientScraper
from healthtools.scrapers.nhif_outpatient_cs import NhifOutpatientCsScraper
if __name__ == "__main__":
# Initialize the Scrapers
doctors_scraper = DoctorsScraper()
foreign_doctors_scraper = ForeignDoctorsScraper()
clinical_officers_scraper = ClinicalOfficersScraper()
healthfacilities_scraper = HealthFacilitiesScraper()
nhif_inpatient_scraper = NhifInpatientScraper()
nhif_outpatient_scraper = NhifOutpatientScraper()
nhif_outpatient_cs_scraper = NhifOutpatientCsScraper()
# Run the scrapers
'''
Doctors Scraper
---------------
Doctors are a combination of local and foreign doctors. If the local
doctors' scraper fails, we shouldn't scrape the foreign doctors.
'''
doctors_result = doctors_scraper.run_scraper()
if doctors_result:
foreign_doctors_scraper.doc_id = len(doctors_result)
foreign_docs_result = foreign_doctors_scraper.run_scraper()
'''
Clinical Officers Scraper
-------------------------
Scrapes the clinical officers website.
'''
clinical_officers_result = clinical_officers_scraper.run_scraper()
'''
Health Facilities Scraper
-------------------------
Scrapes the government's Kenya Health Facilities Master List.
'''
healthfacilities_result = healthfacilities_scraper.run_scraper()
'''
NHIF Scraper
-------------------------
Scrapes the NHIF website for accredited hospital / facitilities.
'''
nhif_inpatient_result = nhif_inpatient_scraper.run_scraper()
nhif_outpatient_result = nhif_outpatient_scraper.run_scraper()
nhif_outpatient_cs_result = nhif_outpatient_cs_scraper.run_scraper()