i’m trying to get the text in the reference class div without getting the text in the inner div.
I just want what’s inside a <div class="class1">
-> "123456789" without taking "abcdefg".
<div class="class0">
<div class="class1">
<div class="class2">
abcdefg
</div>
123456789
</div>
</div>
i tried to run this but it always takes the text i don’t want
String text = doc.getElementsByClass("class1").html();
String text2 = text.replaceAll("</?div[^>]*>","");
Log.d("text2", text2 );
output:
abcdefg
123456789
but I just want 123456789
how can I do? thank you all
2
Answers
i solved now by myself
Try