On Apr 21, 2008, at 6:40 AM, Stephen Nelson-Smith wrote:

> On 4/21/08, Andreas Kostyrka <[EMAIL PROTECTED]> wrote:
> I want to stick with standard library.
>
> How do you capture <dt> elements?


from xml.etree import ElementTree

document = """
<html>
    <head>
       <title>foo and bar</title>
     </head>
     <body>
        <dt>foo</dt>
        <dt>bar</dt>
     </body>
</html>
"""

dt_elements = ElementTree.XML(document).findall('dt')

-jeff

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to