一、item的编写
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class AutopjtItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
#定义好name用来存储商品名
name=scrapy.Field()
#定义好price用来存储商品价格
price=scrapy.Field()
#定义好link用来存储商品链接
link=scrapy.Field()
#定义好comnum用来存储商品评论数
comnum=scrapy.Field()
二、pipeline的编写
# -*- coding: utf-8 -*-
import codecs
import json
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class AutopjtPipeline(object):
def __init__