Skip to content

Commit

Permalink
Support dict items from spider output
Browse files Browse the repository at this point in the history
  • Loading branch information
redapple committed Jun 30, 2016
1 parent 306b9a0 commit 64e7b51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scrapy_magicfields/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(self, mfields, settings):

def process_spider_output(self, response, result, spider):
for _res in result:
if isinstance(_res, BaseItem):
if isinstance(_res, (BaseItem, dict)):
for field, fmt in self.mfields.items():
_res.setdefault(field, _format(fmt, spider, response, _res, self.fixed_values))
yield _res
Expand Down

0 comments on commit 64e7b51

Please sign in to comment.