Search This Blog

Tuesday, June 30, 2009

Python Read Html with "urllib" module

Update: use urllib2. Very good design and comes with standard Python. Support header, data, etc...
more examples, here.

Read Google's home page with Python in 3 lines.

import urllib
html = urllib.urlopen("")
print html.readlines() #read the pages

Read more on stackoverflow regarding httplib, urllib, urllib2

Bleeding edge httplib2 module (not standard)

No comments: