title: Using urllib and BeautifulSoup to retrieve info from web with Python
body: <p>I can get the html page using urllib, and use BeautifulSoup to parse the html page, and it looks like that I have to generate file to be read from BeautifulSoup.</p>
  
  <pre><code>import urllib                                       
  sock = urllib.urlopen("http://SOMEWHERE") 
  htmlSource = sock.read()                            
  sock.close()                                        
  --&gt; write to file
  </code></pre>
  
  <p>Is there a way to call BeautifulSoup without generating file from urllib?</p>