I have a problem parsing with PHP Simple HTML DOM -lib.
HTML:
<td>
<span>text</span>
actual text i want to pick up
<span>text2</span>
</td>
I dont know how to get the “actual text i want to pick up” -part from that.
$node->innertext and $node->plaintext have the text inside the span-tags aswell.
edit:
I have tried
$node->innertext // prints the whole thing
$node->plaintext // prints "textactual text i want to pick uptext"
$node->tag //prints td
The manual doesnt seem to give any clear mention for a case like mine.
If there is a better way to parse html than that library, I am open to other suggestions aswell. I have mostly gotten what I want with that library, but this text I havent been able to pick up.
Ok, I figured how to access the needed information. Tried different combinations about $node->children($x)->innertext, but that didnt help. This way doesnt feel “right”, but works in my case.