I am using beautiful soup to scrap data from Foodily-food website. I am new to python so I have litle knowledge of file handling in python, my requirement is to scrap data from above above url and then download an image and uploading that to my project.
I have got src of image using:
image = soup.find("img",{"itemprop":"image"})['src']
Now I need to download this image and then upload it. I have used below code to retrieve image and read it:
img = urllib2.urlopen(image)
html = img.read()
return HttpResponse(html)
I have got output in some encoded form and don't what to do further with it.
Any guidance would be appreciated.