"find element `a` that contains string ""TEXT A"" in file `root`","e = root.xpath('.//a[contains(text(),""TEXT A"")]')"