From 776b9a00f250e7270a98555795098b781ce18c4b Mon Sep 17 00:00:00 2001 From: henningxtro Date: Sun, 16 May 2021 23:16:57 +0200 Subject: [PATCH] Connected Api to Crawler --- Crawler/api.py | 4 ++++ Crawler/requirements.txt | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Crawler/api.py b/Crawler/api.py index 92617c4..0779b45 100644 --- a/Crawler/api.py +++ b/Crawler/api.py @@ -1,6 +1,9 @@ from flask import Flask from flask_restful import Resource, Api, reqparse +import crawler +import sql + app = Flask(__name__) api = Api(app) @@ -17,6 +20,7 @@ class CrawlerApi(Resource): def post(self): # Accept crawler request here args = parser.parse_args() + crawler.crawl(args['products']) return args diff --git a/Crawler/requirements.txt b/Crawler/requirements.txt index f7b6180..a704f27 100644 --- a/Crawler/requirements.txt +++ b/Crawler/requirements.txt @@ -3,4 +3,5 @@ flask==1.1.2 flask-sqlalchemy flask_restful beautifulsoup4 -requests \ No newline at end of file +requests +lxml \ No newline at end of file