How can I get the text that is between the tags (I can use any library, but better than JSOUP) for example:

<div class="123"> <div class="spoiler-title "><b>....</b></div> <br>Текст который нужно взять`введите сюда код` <div class="spoiler-body">....</div> </div> <br>Текст который нужно взять`введите сюда код <hr> <div class="spoiler-title "><b>....</b></div> 

How can I get text between divs? I tried to take the brothers, but the text was not there (

How can it be different?

    1 answer 1

    First way:
    1) Use Scanner to read line by line. Link, if you forgot how to
    2) Use "split" to split line by <br> and assign that to String[] array
    3) after add line = array[1];

    Second way:
    1) Find index (position) of the tag and use substring to cut string. Link to the answer

    Nadeyus eto pomozhet

    Translation:

    enter image description here

    • Please, translate answer to Russian, I think, that every online translater can be used
    • @ YuriySPb translated - Antonio112009
    • one
      @ Antonio112009 translation would be worth posting as text. - PashaPash