mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2024-12-22 19:55:12 +00:00
Connected Api to Crawler
This commit is contained in:
parent
2067a47fb2
commit
776b9a00f2
|
@ -1,6 +1,9 @@
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask_restful import Resource, Api, reqparse
|
from flask_restful import Resource, Api, reqparse
|
||||||
|
|
||||||
|
import crawler
|
||||||
|
import sql
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
api = Api(app)
|
api = Api(app)
|
||||||
|
|
||||||
|
@ -17,6 +20,7 @@ class CrawlerApi(Resource):
|
||||||
def post(self):
|
def post(self):
|
||||||
# Accept crawler request here
|
# Accept crawler request here
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
crawler.crawl(args['products'])
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,4 +3,5 @@ flask==1.1.2
|
||||||
flask-sqlalchemy
|
flask-sqlalchemy
|
||||||
flask_restful
|
flask_restful
|
||||||
beautifulsoup4
|
beautifulsoup4
|
||||||
requests
|
requests
|
||||||
|
lxml
|
Loading…
Reference in New Issue
Block a user