How can I find this snippet of HTML in a node using jSoup:
<span style="font-weight: bold">Party Date:</span> 14.08.2012<br>
I'd like to extract the date from the HTML snippet. The problem is that this snippet of HTML can occur anywhere within an Element so I need to match it using the contained text.
If you are still looking for jsoup selector query.. this works for me..
String html = "<span style=\"font-weight: bold\">Party Date:</span> 14.08.2012<br>";
System.out.println("Date " + Jsoup.parse(html).select("span:matchesOwn(Party Date:)").first().nextSibling().toString());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With