Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Improve syntax for readability

Joaquin Garmendia Cabrerae1f8b55ba0a1
diff --git a/docs/topics/item-pipeline.rst b/docs/topics/item-pipeline.rst
index 1c2c51e05..fae18200a 100644
--- a/docs/topics/item-pipeline.rst
+++ b/docs/topics/item-pipeline.rst
@@ -87,8 +87,8 @@ contain a price::
vat_factor = 1.15
def process_item(self, item, spider):
- if 'price' in item and item['price']:
- if 'price_excludes_vat' in item and item['price_excludes_vat']:
+ if item.get('price'):
+ if item.get('price_excludes_vat'):
item['price'] = item['price'] * self.vat_factor
return item
else: