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
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user