Once you have used the etree.ElementTree
constructor to instantiate an XML document, you can use
these attributes on methods on that instance.
This method searches the tree for matching elements, and
returns the first one that matches, or None if there are no matches. For an instance of an ETElementTree:
ET.find ( path )
The path argument is a string describing
the element for which you are searching. Possible values
include:
"tag"
Find the first child element whose name is ".
tag"
"tag1/tag2/.../tagn"
Find the first child element whose name is ; then, under that child
element, find its first child named tag1; and so forth.
tag2
For example, suppose you have an ElementTree instance named page, containing an XHTML page. Further
suppose you want to find the link
element inside the head element
inside the root html element. This
statement would set the variable linkElt to that link element:
linkElt = page.find ( "html/head/link" )