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