Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from twisted.internet import reactor
- def write_csv(item, **kwargs):
- f = kwargs['csv_file_obj']
- formatted_data = format(item)
- f.writerow(formatted_data)
- def format(item):
- pass
- #from scrapy
- # store the file object
- class Yourpipeline(object):
- def process_item(self, item, spider):
- reactor.callInThread(write_csv, item = item, csv_file_obj = spider.csv_file_obj)
- return item
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement