session=requests.Session()
session.cookies.clear()
session.keep_alive = False
session.headers = {'Connection':'close', 'User-Agent': agent} #agent - random
page=session.get(url, proxies={'http':'http://'+IP}, timeout=(60,60)) # IP - rotation
session.cookies.clear()
from flask import Flask,jsonify
app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False
@app.route('/')
def default():
return jsonify(a=u"\u20AC".encode('utf8'))
if __name__ == "__main__":
app.run(debug=True,port=8765)
...
rec=cnn.fetchall()
response = make_response(excel.make_response_from_array(rec, "xls"))
response.headers['Content-Type'] = 'application/vnd.ms-excel'
response.headers['Content-Disposition'] = 'attachment; filename=result.xls'
return response