# -*- 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()  # 成交额
[((665, 676), 'scrapy.loader.processors.TakeFirst', 'TakeFirst', ([], {}), '()\n', (674, 676), False, 'from scrapy.loader.processors import TakeFirst\n'), ((812, 826), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', (824, 826), False, 'import scrapy\n'), ((846, 860), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', (858, 860), False, 'import scrapy\n'), ((886, 900), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', (898, 900), False, 'import scrapy\n'), ((924, 938), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', (936, 938), False, 'import scrapy\n'), ((960, 974), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', (972, 974), False, 'import scrapy\n'), ((1003, 1017), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', (1015, 1017), False, 'import scrapy\n'), ((1040, 1054), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', (1052, 1054), False, 'import scrapy\n'), ((1078, 1092), 'scrapy.Field', 'scrapy.Field', ([], {}), '()\n', (1090, 1092), False, 'import scrapy\n')]