scrapy中items.py中是这么定义的,
class CnnvdScrapyItem(scrapy.Item):
# define the fields for your item here like:
name = scrapy.Field()
CNNVD_id = scrapy.Field()
CVE_id = scrapy.Field()
#level = scrapy.Field()
pubdate = scrapy.Field()
update_time = scrapy.Field()
brief = scrapy.Field()
pipeline.py中是这么处理的
class CnnvdScrapyPipeline:
def __init__(self):
self.file = open('items.json', 'w')
def process_item(self, item, spider):
line = json.dumps(dict(item), ensure_ascii = False) + "\n"
self.file.write(line)
return item
def close_spider(self, spider):
self.file.close()
请问我应该怎么修改,才能实现让items不同类之间自动空一行,(如下图箭头处,我希望让箭头位置自动产生一行空行)。