from flask import Flask, render_template, request from webscout import WEBS import arrow app = Flask(__name__) @app.route('/', methods=['GET']) def home(): keywords = request.args.get('keywords', 'india') timelimit = request.args.get('timelimit', 'd') text_list = [] with WEBS() as webs_instance: WEBS_images_gen = webs_instance.text( keywords, region="wt-wt", safesearch="off", timelimit=timelimit, max_results=100 ) for r in WEBS_images_gen: text_list.append(r) return render_template('text.html', text=text_list, keywords=keywords) if __name__ == '__main__': app.run(debug=True)