-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
33 lines (25 loc) · 814 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from flask import Flask, render_template, request
import parcer as p
app = Flask(__name__, static_folder="static")
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
text = request.form['text']
print(text)
vacs = p.hh_ru(text)
print(vacs)
return render_template('table.html', list_a=vacs)
else:
return render_template('index.html')
@app.route('/search', methods=['GET', 'POST'])
def search():
if request.method == 'POST':
text = request.form['text']
print(text)
vacs = p.hh_ru(text)
print(vacs)
return render_template('table.html', list_a=vacs)
else:
return render_template('table.html')
if __name__ == '__main__':
app.run()