saving images with pipelines (scrapy+mongoDB)

153 views
Skip to first unread message

Zied Boughammoura

unread,
Apr 3, 2017, 9:15:41 AM4/3/17
to scrapy-users
hello scrapy users!

i'm working with scrapy + mongoDB...
i need to load images to mongoDB uisng pipelines (i mean full image not saving the path in the OS folder)
what i have is :
****spider***
item['file_urls']=response.xpath('//div[@id="imgTagWrapperId"]/img[@id="landingImage"]/@src').extract()

******items***
    file_urls = scrapy.Field()
    files = scrapy.Field()

****settings***
ITEM_PIPELINES = {
    'scrapy.pipelines.images.FilesPipeline': 1,
    'full.pipelines.MongoDBPipeline': 300,  
}
 
FILES_STORE = '/home/Desktop/output'

thanks in advance, 
Reply all
Reply to author
Forward
Message has been deleted
0 new messages