a HTML file:
<html>
<body>
<div class="main">
<p id="tID">content</p>
</div>
</body>
</html>
i has a String == "content",
i want to use "content" get HTML DOM path:
html body div.main p#tID
chrome developer tools has this feature(Elements tag,bottom bar), i want to know how to do it in java?
thanks for your help 🙂
Have fun 🙂
JAVA CODE
XML EXAMPLE
EXPLANATIONS
documentpoints to evaluated XML.//*[text()='content']finds everthing with text = ‘content’, and find the node.whileloops up to the first node, getting id and classes of current element.MORE EXPLANATIONS
<br>, for example, and cleaner will replace with<br/>.