Python 3:
import urllib.request
wp = urllib.request.urlopen("http://google.com")
pw = wp.read()
print(pw)
Python 2:
import urllib
import sys
wp = urllib.urlopen("http://google.com")
for line in wp:
sys.stdout.write(line)
While I have tested both the Codes in respective versions.