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

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html

import os
class DaomuPipeline(object):
    def process_item(self, item, spider):
        directory = 'D:/novel/{}/'.format(item['title'])
        if not os.path.exists(directory):
            os.makedirs(directory)
        filename = directory + item['name'] + '.txt'
        with open(filename,'w',encoding='utf-8') as f:
            f.write(item['content'])
        return item

e204af9bfc1687348d1dd2b1304b9e397c91a39e
<mask token>

<mask token>


class DaomuPipeline(object):
    <mask token>

<mask token>


class DaomuPipeline(object):

    def process_item(self, item, spider):
        directory = 'D:/novel/{}/'.format(item['title'])
        if not os.path.exists(directory):
            os.makedirs(directory)
        filename = directory + item['name'] + '.txt'
        with open(filename, 'w', encoding='utf-8') as f:
            f.write(item['content'])
        return item

import os


class DaomuPipeline(object):

    def process_item(self, item, spider):
        directory = 'D:/novel/{}/'.format(item['title'])
        if not os.path.exists(directory):
            os.makedirs(directory)
        filename = directory + item['name'] + '.txt'
        with open(filename, 'w', encoding='utf-8') as f:
            f.write(item['content'])
        return item

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

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html

import os
class DaomuPipeline(object):
    def process_item(self, item, spider):
        directory = 'D:/novel/{}/'.format(item['title'])
        if not os.path.exists(directory):
            os.makedirs(directory)
        filename = directory + item['name'] + '.txt'
        with open(filename,'w',encoding='utf-8') as f:
            f.write(item['content'])
        return item
