![](https://i-blog.csdnimg.cn/blog_migrate/b580611e12bc4b6675fe1274de2d9daa.png)
[url=][/url]
1 # -*- coding: utf-8 -*- 2 3 # Define here the models for your scraped items 4 # 5 # See documentation in: 6 #http://www.smpeizi.com/en/latest/topics/items.html 7 8 import scrapy 9 10 11 class AuthorInfo(scrapy.Item):12 authorName = scrapy.Field() # 作者昵称13 authorUrl = scrapy.Field() # 作者Url14 15 class ReplyItem(scrapy.Item):16 content = scrapy.Field() # 回复内容17 time = scrapy.Field() # 发布时间18 author = scrapy.Field() # 回复人(AuthorInfo)19 20 class TopicItem(scrapy.Item):21 title = scrapy.Field() # 帖子标题22 url = scrapy.Field() # 帖子页面Url23 content = scrapy.Field() # 帖子内容24 time = scrapy.Field() # 发布时间25 author = scrapy.Field() # 发帖人(AuthorInfo)26 reply = scrapy.Field() # 回复列表(ReplyItem list)27 replyCount = scrapy.Field() # 回复条数[url=][/url]
[url=]
[/url]
1 # -*- coding: utf-8 -*- 2 from scrapy.selector import Selector