import urllib2 req = urllib2.Request("http://localhost:8080") res = urllib2.urlopen( req ) headers = str(res.info()) print(headers) html=res.read() print(html)