I have the following html code
<div id="brandModel">
Jeep Grand Cherokee,
<span class="red">529.80 EUR</span>
</div>
The following PHP/Xpath works, but also returns the text inside span.
$xPathcarName = $xpath->query( "//div[@id='brandModel']" );
echo $xPathcarName->item(0)->textContent\r\n";
Output:
Jeep Grand Cherokee,
529.80 EUR
I only want the textContent inside the div, not inside the span. Is this possible?
Thanks