[scrapy.core.scraper] DEBUG
时间: 2024-06-05 19:06:58 浏览: 159
Scrapy is a Python web crawling framework that provides a simple and efficient way to extract data from websites. The [scrapy.core.scraper] DEBUG message is a debug message that indicates that the scraper component of Scrapy is running. This message is usually accompanied by other debug messages that provide more information about the scraping process, such as the URLs being scraped, the data being extracted, and any errors or exceptions that occur during the process. These debug messages are useful for troubleshooting and fine-tuning the Scrapy spider to ensure that it is extracting the data that you need in the most efficient way possible.
相关问题
[scrapy.core.scraper] DEBUG: Scraped from <200 https://sh.lianjia.com/zufang/pg2/>
{
'title': '整租 · 小区环境优美,采光好,家具齐全,拎包入住',
'price': '6300 元/月',
'area': '南京西路',
'rooms': '2室1厅1卫',
'floor': '高楼层(共6层)',
'url': 'https://sh.lianjia.com/zufang/SH2441600934478758400.html'
}
解释class MyspiderItem(scrapy.Item): title = scrapy.Field() #剧名 fraction = scrapy.Field() #评分 region = scrapy.Field() #国家或地区 time = scrapy.Field() #时长 date = scrapy.Field() #上映日期 director = scrapy.Field() #导演
这是一个 scrapy 爬虫项目中定义的数据模型。
class MyspiderItem(scrapy.Item) 定义了一个名为 MyspiderItem 的类,它继承自 scrapy.Item 。
scrapy.Item 是 scrapy 提供的一个用于定义数据模型的基类,它提供了一个字典结构来存储数据,并且可以使用类似字典的方式来访问数据。
title、fraction、region、time、date 和 director 都是该数据模型中的属性,它们都是 scrapy.Field() 类型的对象,表示该属性是一个字段,可以存储任意类型的数据。
在 scrapy 爬虫项目中,当爬虫解析器解析了页面之后,会将解析结果存储到该数据模型中,并交给 scrapy pipeline 进行处理。
阅读全文