title: Extract text data from website using Python:
body: <p>I am trying to extract text data from website using regex but problem is it is not completely extracting. I am following this tutorial: <a href="https://pythonprogramming.net/parse-website-using-regular-expressions-urllib" rel="nofollow">https://pythonprogramming.net/parse-website-using-regular-expressions-urllib</a> 
  but i dont know where i am wrong. The website i am extracting text from is <a href="http://www.sanfoundry.com/c-programming-questions-answers-variable-names-1/" rel="nofollow">http://www.sanfoundry.com/c-programming-questions-answers-variable-names-1/</a> and its relevant sublinks as well.</p>
  
  <p>Code:</p>
  
  <pre><code>import urllib2
  from urllib2 import Request
  import re
  #url = "http://www.tutorialspoint.com/cplusplus/cpp_basic_syntax.htm"
  url = "http://www.sanfoundry.com/c-programming-questions-answers-variable-names-1/"
  
  req = Request(url)
  resp = urllib2.urlopen(req)
  respData = resp.read()
  
  regex = '&lt;p.*?&gt;(.*?)&lt;\/p&gt;'
  
  paragraphs = re.findall(regex,str(respData))
  
  
  for eachP in paragraphs:
      print(eachP)
  </code></pre>
  
  <p>any idea ???</p>