examples/other/web_client.py
#!/usr/bin/env python
from __future__ import print_function

import urllib

# f is like a filehand for http requests
f = urllib.urlopen('http://python.org/')
html = f.read()   # is like a get() request
f.close()

print(html)


# retrieve a file and save it locally:
urllib.urlretrieve('http://www.python.org/images/python-logo.gif', 'logo.gif')