Answer the question
In order to leave comments, you need to log in
How to get the text which is after the br tags?
How can I take the text of which is between the tags (I can use any library, but JSOUP is better) 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>
Answer the question
In order to leave comments, you need to log in
Not familiar with JSOUP, however, project my solution to Java, the idea is the same:
<div class="123">
<div class="spoiler-title"><b>....</b></div>
<br>Текст который нужно взять`введите сюда код`
<div class="spoiler-body">....</div>
</div>
<script>
(function()
{
var div_elems = document.getElementsByClassName('123');
var div123 = div_elems[0];
// Следующим шагом вместо того, чтобы получать содержимое тега ( = div123.innerHTML) пройдемся по его потомкам
var childs = div123.childNodes;
var div_spoiler_title = childs[0];
var br_elem = childs[1];
var text_elem = childs[2]; // в этом узле ваш текст
var div_spoiler_body = childs[3];
})();
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question