Created
February 28, 2013 20:54
-
-
Save ojacquemart/5060041 to your computer and use it in GitHub Desktop.
Get webpage content in python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
response = urllib2.urlopen('http://github.com') | |
html = response.read() | |
print html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update to urllib3
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'http://google.com/')
print r.status, r.data
https://pypi.python.org/pypi/urllib3