Get text from next tag
I have an html snippet that looks like this (of course, surrounded by another html):
<p class="finfot3"><b>Header:</b></p> <p>Text</p> How can I get Text from this? I use simple_html_dom, but I can use something else if simple_html_dom cannot do this.
+3
Marwelln
source share3 answers
This is not verified, but you can look for the simple_html_doms next_sibling() method.
$html->find('p[class=finfot3]')->next_sibling()->innertext() should return the contents of the second <p> element.
+5
Leigh
source share