Getting a DOM element's children by type (STUPID)

Diez B. Roggisch deets at web.de
Thu Jun 9 01:46:02 CEST 2005


Tom Anderson wrote:
> This strikes me as a rather common thing to want to do, but i can't see 
> a method for it; it seems i have to go through elem.childNodes myself, 
> fishing out the ones i want. Or rather, to write exactly the same 
> three-line helper function that millions of other people must have 
> written to do this. Am i missing something blindingly obvious? I'm happy 
> to RTFM here, but would appreciate a pointer to the appropriate such 
> manual, since the docs i have to hand are somewhat unenlightening.

No RTFM here - it's just that (stupid..) way. Go read up RTFMs on 
elementtree or XPath though - they'll do what you want.

Diez



More information about the Python-list mailing list