最佳答案
I'm running over all textnodes of my DOM and check if the nodeValue contains a certain string.
/html/body//text()[contains(.,'test')]
This is case sensitive. However, I also want to catch Test, TEST or TesT. Is that possible with XPath (in JavaScript)?