Update item-pipeline example

This commit is contained in:
Joaquin Garmendia Cabrera 2018-12-23 00:26:58 -05:00 committed by GitHub
parent 886513c375
commit f85c915872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -87,8 +87,8 @@ contain a price::
vat_factor = 1.15
def process_item(self, item, spider):
if item['price']:
if item['price_excludes_vat']:
if 'price' in item and item['price']:
if 'price_excludes_vat' in item and item['price_excludes_vat']:
item['price'] = item['price'] * self.vat_factor
return item
else: