i has a String content:
String content="<HTML>"
+"<HEAD>"
+" <meta content=\"text/html; charset=UTF-8\" http-equiv=\"content-type\">"
+" <TITLE>title</TITLE>"
+"</HEAD>"
+"<BODY>"
+"<div id=\"test\">hello world!</div>"
+"</BODY>"
+"</HTML>"
;
i want to use HTML selector:
#test
to get Element <div id="test">hello world!</div>
which java library can do this? (better same as most like javascript)
thanks 🙂
JSoup will suit your problem just fine. You can do this….
This works exactly like JQuery. You can use CSS-like Selector-syntax to retrieve elements.