title: Inherent way to save web page source
body: <p>I have read a lot of answers regarding web scraping that talk about BeautifulSoup, Scrapy e.t.c. to perform web scraping.</p>
  
  <p>Is there a way to do the equivalent of saving a page's source from a web brower?</p>
  
  <p>That is, is there a way in Python to point it at a website and get it to save the page's source to a text file with just the standard Python modules?</p>
  
  <p>Here is where I got to:</p>
  
  <pre><code>import urllib
  
  f = open('webpage.txt', 'w')
  html = urllib.urlopen("http://www.somewebpage.com")
  
  #somehow save the web page source
  
  f.close()
  </code></pre>
  
  <p>Not much I know - but looking for code to actually pull the source of the page so I can write it. I gather that urlopen just makes a connection.</p>
  
  <p>Perhaps there is a readlines() equivalent for reading lines of a web page? </p>