# -*- coding: utf-8 -*-

# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html

import scrapy
from scrapy.loader import ItemLoader
from scrapy.loader.processors import TakeFirst


# class SpiderItem(scrapy.Item):
#     # define the fields for your item here like:
#     # name = scrapy.Field()
#     pass
#
#
#
# class TorrentItem(scrapy.Item):
#     url = scrapy.Field()
#     name = scrapy.Field()
#     description = scrapy.Field()
#     size = scrapy.Field()
#
#     import scrapy

class StockstarItemLoader(ItemLoader):

    # 自定义itemloader,用于存储爬虫所抓取的字段内容
    default_output_processor = TakeFirst()

class StockstarItem(scrapy.Item):  # 建立相应的字段

    # define the fields for your item here like:
    # name = scrapy.Field()
    code = scrapy.Field()  # 股票代码
    abbr = scrapy.Field()  # 股票简称
    last_trade = scrapy.Field()  # 最新价
    chg_ratio = scrapy.Field()  # 涨跌幅
    chg_amt = scrapy.Field()  # 涨跌额
    chg_ratio_5min = scrapy.Field()  # 5分钟涨幅
    volumn = scrapy.Field()  # 成交量
    turn_over = scrapy.Field()  # 成交额
[(31, 'scrapy.loader.processors.TakeFirst', 'TakeFirst', False, 'from scrapy.loader.processors import TakeFirst\n'), (37, 'scrapy.Field', 'scrapy.Field', False, 'import scrapy\n'), (38, 'scrapy.Field', 'scrapy.Field', False, 'import scrapy\n'), (39, 'scrapy.Field', 'scrapy.Field', False, 'import scrapy\n'), (40, 'scrapy.Field', 'scrapy.Field', False, 'import scrapy\n'), (41, 'scrapy.Field', 'scrapy.Field', False, 'import scrapy\n'), (42, 'scrapy.Field', 'scrapy.Field', False, 'import scrapy\n'), (43, 'scrapy.Field', 'scrapy.Field', False, 'import scrapy\n'), (44, 'scrapy.Field', 'scrapy.Field', False, 'import scrapy\n')]