Run an XPath query on the HTML document and print matches.

def queryHTML(self, path):
        """Run an XPath query on the HTML document and print matches."""
        if etree is None:
            raise Exception("lxml not available")
        document = etree.HTML(self.contents)
        for node in document.xpath(path):
            if isinstance(node, basestring):
                print node
            else:
                print etree.tostring(node, pretty_print=True).strip()