scrapy csvfeed spider

class CsvspiderSpider(CSVFeedSpider):
    name = 'csvspider'
    allowed_domains = ['iqianyue.com']
    start_urls = ['http://iqianyue.com/feed.csv']
    headers = ['id', 'name', 'description', 'image_link']
    delimiter = ','

    # Do any adaptations you need here
    #def adapt_response(self, response):
    #    return response

    def parse_row(self, response, row):
        i = item()
        i['url'] = row['url']
        i['name'] = row['name']
        i['description'] = row['description']
        return i

 

posted @ 2017-05-10 13:51  Erick-LONG  阅读(314)  评论(0编辑  收藏  举报