Basically, I need to get the text between two span tags, and I've tried a bunch of different methods with no solution. I'm using Simple HTML DOM Parser (http://simplehtmldom.sourceforge.net/) too, so what I can do is a little restricted to. Here is the basic setup:
<span class=1>text here</span> TEXT I NEED TO GET <span class=2>more text</span>
Any help?
The text between the span elements should be a DOMTextNode and sibling to the span elements. If SimpleHTMLDom follows DOM specs you should be able to get it with:
$text = $html->find('span[class=1]', 0)->next_sibling();
If that doesnt work, consider using a more proper parser that is based on libxml, e.g. see
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