# -*- 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, 31, 31, 42), 'scrapy.loader.processors.TakeFirst', 'TakeFirst', ({}, {}), '()', False, 'from scrapy.loader.processors import TakeFirst\n'), ((37, 11, 37, 25), 'scrapy.Field', 'scrapy.Field', ({}, {}), '()', False, 'import scrapy\n'), ((38, 11, 38, 25), 'scrapy.Field', 'scrapy.Field', ({}, {}), '()', False, 'import scrapy\n'), ((39, 17, 39, 31), 'scrapy.Field', 'scrapy.Field', ({}, {}), '()', False, 'import scrapy\n'), ((40, 16, 40, 30), 'scrapy.Field', 'scrapy.Field', ({}, {}), '()', False, 'import scrapy\n'), ((41, 14, 41, 28), 'scrapy.Field', 'scrapy.Field', ({}, {}), '()', False, 'import scrapy\n'), ((42, 21, 42, 35), 'scrapy.Field', 'scrapy.Field', ({}, {}), '()', False, 'import scrapy\n'), ((43, 13, 43, 27), 'scrapy.Field', 'scrapy.Field', ({}, {}), '()', False, 'import scrapy\n'), ((44, 16, 44, 30), 'scrapy.Field', 'scrapy.Field', ({}, {}), '()', False, 'import scrapy\n')]