Opening HTML Documents : Parse HTML : Network PYTHON TUTORIALS


PYTHON TUTORIALS » Network » Parse HTML »

 

Opening HTML Documents


import urllib

webURL = "http://www.python.org"
localURL = "index.html"

u = urllib.urlopen(webURL)
buffer = u.read()
print u.info()
print "Read %d bytes from %s.n" (len(buffer), u.geturl())

u = urllib.urlopen(localURL)
buffer = u.read()
print u.info()
print "Read %d bytes from %s." (len(buffer), u.geturl())



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Network
» Parse HTML