removing date pipeline
This commit is contained in:
parent
c394575137
commit
8baa108aab
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user