removing date pipeline

This commit is contained in:
rugantio 2019-04-23 08:22:48 +02:00
parent c394575137
commit 8baa108aab

View File

@ -9,10 +9,11 @@ from scrapy.exceptions import DropItem
from datetime import datetime
class FbcrawlPipeline(object):
def process_item(self, item, spider):
if item['date'] < datetime(2017,1,1).date():
raise DropItem("Dropping element because it's older than 01/01/2017")
elif item['date'] > datetime(2018,3,4).date():
raise DropItem("Dropping element because it's newer than 04/03/2018")
else:
return item
pass
# def process_item(self, item, spider):
# if item['date'] < datetime(2017,1,1).date():
# raise DropItem("Dropping element because it's older than 01/01/2017")
# elif item['date'] > datetime(2018,3,4).date():
# raise DropItem("Dropping element because it's newer than 04/03/2018")
# else:
# return item