title: How to do a normal functions in python flask without a route and return the results of this process using a route?
body: <p>The app is loading the "links_submit.html" which has a field where you can write a link, like for example (www.google.com) and you submit it, then the app is receiving this URL as HTTP Post and redirecting to another page "post_response.html" which contains a simple html for feedback with the word "Ok". Then I want to do a process with this link (crawl google and search for a specific thing) and after finish this process, automatically redirect from the "post_reponse.html" to another page to show the results I have extracted from google. Now I'm not sure how say to my app on flask: "Ok now lets use a normal function (not route) like for example:</p>
  
  <pre><code>def loadpage(link_sent_by_the_http post):
     res = requests.get('www.google.com')
  </code></pre>
  
  <p>Imagine that after load the page I also extract some html tag on google and after finish this process I want to redirect the page "post_respose.html" with the "ok" to a new html page which contains the html tag extracted from google.
  Please note I know how to load the page google and extract what I want, but I don't know how to insert this function/process in the middle of Flask and then redirect from a normal html with "ok" for a new route with the results I have extracted.</p>
  
  <pre><code>import requests
  from flask import Flask, render_template, request, url_for
  
  app = Flask(__name__)
  
  @app.route('/test')
  def form():
     return render_template('links_submit.html')
  
  @app.route('/links/', methods=['POST'])
  def links():
      links=request.form['links']
      return render_template('post_response.html')
  
  Intern Process (Load the received link &gt; Extract what I want)
  and then redirect the "post_response.html" to another "html" which will
  contain the results that I have extracted) 
  
  if __name__ == '__main__':
    app.run(debug=True)
  </code></pre>