-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
31 lines (21 loc) · 832 Bytes
/
main.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
import os
import argparse
from floodlist.call import Scraper
from floodlist.floodlist.pipelines import items
from itemadapter import ItemAdapter
def getfloodlist(start, end, country):
start_date_list = [start]
end_date_list = [end]
countrylist = [country]
scraper = Scraper(start_date_list, end_date_list, countrylist)
scraper.run_spiders()
return items
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--start", help="Initial Date - Must be in String : YYYY/MM/DD")
parser.add_argument("--end", help="Final Date - Must be in String : YYYY/MM/DD")
parser.add_argument("--country", help="Country Name")
args = parser.parse_args()
flood_list = getfloodlist(args.start, args.end, args.country)
for flood in flood_list:
print(flood)