Scrapy Define an Item - Scrapy

How to define an item using Scrapy?

Description

Items are the containers which are used for collecting the data that is scrapped from the websites. You should start your spider by defining your Item. To define items, edit items.py file found under directory first_scrapy (custom directory). items.py looks like as shown below

MyItem class will inherit from Item which consists of a number of pre-defined objects that Scrapy has already built for us. For example, if you want to extract the name, URL and description from the sites, you should define the fields for each of these three attributes.

Therefore, let's add those items that we want to collect

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Scrapy Topics