To do it properly you need to traverse all elements of the DOM using QWebElement API, look for your text and act accordingly.