Commit 82de5c11 authored by Mario Chirinos's avatar Mario Chirinos

last date finder

parent 548fa45c
......@@ -46,13 +46,13 @@ def crawlNews(directory, cfg, endDate=datetime.datetime.now()):
print("start: ", startDate, "end: ", endDate)
delta = endDate-startDate
print("Days to crawl:", delta)
return 0
for i in range(delta.days + 1):
day = startDate + datetime.timedelta(days=i)
yeardir = directory+str(day.year)+"/"
if not os.path.exists(yeardir):
os.mkdir(yeardir)
print("dir: ", yeardir)
print(day)
os.system("scrapy crawl noticias --nolog -O "+yeardir+day.strftime('%Y-%m-%d')+".json -a year="+str(day.year)+" -a month="+str(day.month)+" -a day="+str(day.day)+"")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment