I need a support on the following issue, I have a website where I want to get a product descriptions via xpath. Below the example html of the content:
<div id="description">
<span>some test</span>
<img src="some src">
<p>
some content etc.
</p>
</div>
and now I use the below code:
$result = $xpath->query('//div[@id="description"]');
but when I'm outputting the result with the below line:
echo "<pre>".$result->item( 0 )->nodeValue."</pre>"; // there is always only one element
what I get is only unformatted: "some testsome content etc." with no spaces and other tags. I know it is because xpath treats all the other tags as nodes but...
I there a way to get the div's content as HTML ?