Skip to content

Instantly share code, notes, and snippets.

@hamaluik
Created August 16, 2012 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamaluik/3372222 to your computer and use it in GitHub Desktop.
Save hamaluik/3372222 to your computer and use it in GitHub Desktop.
Getting HTML Data From a Webpage Using Python
#!/usr/bin/env python
import urllib2
# get the html of a url
def GetHTML(url):
# open it up
f = urllib2.urlopen(url)
str = f.read()
return str
# now use it!
html = GetHTML('http://google.ca/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment