title: 'Session' Object is not callable Flask
body: <p>I'm trying to write a web scraping API with Flask, this is the code:</p>
  
  <pre><code>app = Flask(__name__)
  
  
  @app.before_request
  def login():
      session = requests.Session()
  
      url = "someurl"
  
      params = {'uid': 'username',
            'pwd': 'password'}
  
      session.post(url, data=params)
  
      return session
  
  @app.route('/scrape')
  def lezione(session):
  
      req = session.get("urlscraped")
  
      soup = BeautifulSoup(req.content, "lxml")
      table = soup.find_all(
          'table', attrs={'class': 'griglia_tab', 'id': 'data_table'})[2]
      if not table:
          print("List is empty")
      print(re.sub(r'\n\s*\n', '\n', table.text.strip()))
  
  
  if __name__ == "__main__":
      app.run(debug=True, host='localhost', port=5000)
  </code></pre>
  
  <p>Essentially this code login into a site and scrapes some data. What i want to do is to run the <code>login()</code> function before scraping anything, but when i run the code i get the error: <code>TypeError: 'Session' object is not callable</code>
  What's wrong in the code?</p>