Looking for a specific html parser

Davor Cengija dcengija_remove_ at inet.hr
Mon Mar 17 21:53:56 CET 2003

I need to pull out some html elements with its subelements from an html 
document. Is there something already available?

Basically, I need something like this:

parser = NeedThisParser("http://www.myhost.com")
table = parser.getElement("table")
# now table has list of tr elements, each tr element
# has a list of td or th elements, with attributes

# this gives next table
anotherTable = parser.getElement("table")

# this prints the first tr element with its subelements
print table.getElement("tr")
# output:
# tr [('width', '100%'), ('bgcolor', 'gray')]
#    td [('width', '50%')]
#    td [('width', '50%')]
# etc...

allTables = parser.getAllElements("table")
# etc...

I just started with python last week and still don't know what is already 
available and where. 

Davor Cengija, dcengija_remove_ at inet.hr

More information about the Python-list mailing list