I have this code,
import json
from goose import Goose
def extract(url):
g = Goose()
article = g.extract(url=url)
if article.top_image is None:
return "none"
else:
if article.top_image.src is None:
return "none"
else:
resposne = {'image':article.top_image.src}
return article.top_image.src
here instead of "none" I want to return image file. In order to upload image file, do I need to save image in my static file and return that as an Image?I've been doing returning image from static file with html whole time but I'm not sure how to do that with python, or is there other way?