-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (22 loc) · 646 Bytes
/
main.py
File metadata and controls
29 lines (22 loc) · 646 Bytes
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
from flask import Flask, request
from flask_cors import CORS, cross_origin
import requests
from bs4 import BeautifulSoup
import json
import re
from modules.rightmove import getLetProperty
from modules.rightmovejson import scrapeProperty
app = Flask('ts')
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
@app.route('/rightmove', methods=['GET', 'POST'])
@cross_origin()
def rightmove():
url = request.args.get('url')
return scrapeProperty(url)
@app.route('/rightmove-old', methods=['GET', 'POST'])
@cross_origin()
def rightmove_old():
url = request.args.get('url')
return getLetProperty(url)
app.run(debug=True, port=5000)