Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
print page info
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
url, encoding = 'http://stackoverflow.com/q/9445627/', 'utf-8'
response = urlopen(url)
print(response.info())
page_bytes = response.read()
print("Raw bytes:")
print(repr(page_bytes[:40]))
print("Decoded:")
print(page_bytes.decode(encoding))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.