Obtain Web Page Information : GET POST « Network « Python Tutorial






import sys, urllib2

req = urllib2.Request("http://www.google.com")
fd = urllib2.urlopen(req)
print "Retrieved", fd.geturl()
info = fd.info()
for key, value in info.items():
    print "%s = %s" % (key, value)








21.18.GET POST
21.18.1.Submit GET Data
21.18.2.Submit POST Data
21.18.3.Obtain Web Page Information