XPath: addressing language


Examples:

/p/a
//a
//a[@href = "index.html"]
doc = libxml2.htmlParseFile(url, None);
ctxt = doc.xpathNewContext()
anchors = ctxt.xpathEval("//a[@href]")
for anchor in anchors:
    href = anchor.prop("href")

Try "xmllint --shell" to test XPath expressions