title: Parse text response from http request in Python
body: <p>I am trying to fetch data from an APU but as response I am getting the plain text. I want to read all text line by line.</p>
  
  <p>This is the <code>url</code> variable: <a href="http://www.amfiindia.com/spages/NAVAll.txt?t=23052017073640" rel="noreferrer">http://www.amfiindia.com/spages/NAVAll.txt?t=23052017073640</a></p>
  
  <p>First snippet:</p>
  
  <pre><code>from pymongo import MongoClient
  import requests
  from bs4 import BeautifulSoup as bs
  url = "https://www.amfiindia.com/spages/NAVAll.txt?t=23052017073640"
  request = requests.get(url)
  soup = bs(request.text,"lxml")
  for line in soup:
      print line
      break
  </code></pre>
  
  <p><strong>Result</strong>: It prints out the entire text  </p>
  
  <p>Second snippet: </p>
  
  <pre><code>request = requests.get(url)
  for line in request.text():
      print line
      break
  </code></pre>
  
  <p><strong>Result</strong>: It prints out 1 character</p>
  
  <pre><code>request = requests.get(url)
  requestText = request.text()
  allMf = requestText.splitlines()
  </code></pre>
  
  <p><strong>Result</strong>: Exception: 'unicode' object is not callable</p>
  
  <p>I have tried few more cases but not able to read text line by line.</p>