I’m using Python 2.4/2.5, with libxm2dom. I can import an HTML document, and build the DOM. Is there a way to programmatically “search” for a given term, and be able to craft the XPath function to extract the href for the term? For example, given this chunk of HTML from the document:
...
<a href="dog">bigdog</a>
...
I’d like to have an XPath function that would find bigdog, and return the XPath to get the href link.
This XPATH will select the
@hrefof theaelement who’s text is “bigdog”.