# Define here the models for your scraped items # # See documentation in: # https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
classTxmoviesItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() name = scrapy.Field() description = scrapy.Field()
defparse(self, response): items=TxmoviesItem() lists=response.xpath('//div[@class="list_item"]') for i in lists: items['name']=i.xpath('./a/@title').get() items['description']=i.xpath('./div/div/@title').get()
# Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html