From 0c83842d2ec677281bc17e71f7b8e0708155caed Mon Sep 17 00:00:00 2001 From: zhullyb Date: Thu, 16 Nov 2023 08:57:30 +0800 Subject: [PATCH] init webdriver globally --- main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main.py b/main.py index f370aeb..375d3eb 100644 --- a/main.py +++ b/main.py @@ -7,6 +7,7 @@ app = Flask(__name__) data_dict = {} +ss = Screenshot() @app.after_request def set_headers(response): @@ -42,7 +43,4 @@ def quote(): return render_template('main-template.html', data_list=data) if __name__ == '__main__': - # init headless browser - ss = Screenshot() - app.run(host='0.0.0.0', port=Config.FLASK_RUN_PORT)