Skip to content

Instantly share code, notes, and snippets.

@uhziel
Created November 7, 2010 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uhziel/666135 to your computer and use it in GitHub Desktop.
Save uhziel/666135 to your computer and use it in GitHub Desktop.
use a urllib library
import urllib
webpage = urllib.urlopen('http://www.baidu.com')
pagefile = open('baidu.html', 'w')
for lines in webpage.readlines():
pagefile.write(lines)
pagefile.close()
webpage.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment