Estou tentando obter os dados de um DIV que contém a seguinte estrutura:
<div class="item" style="height:273px">
<a href="/arapiraca/anuncios/detalhes/159695-honda-cg-150-2008">
<img alt="" src="/i.php?w=148&h=119&f=3,0|4,0&src=uploads/anunciosfotos/2014/04/858a6126588bdace8bc0f144f900d097.jpg"></img>
<img src="/img/icone-novo.png" alt="" style="position: absolute; z-index: 20; width: 60px; height: 60px; right: -5px; top: -10px; border: 0"></img>
<strong class="nome" style="font-weight:normal">
HONDA CG 150 2008 TITAN - KS GASOLINA
</strong>
<strong class="valor">
R$ 4.500,00
</strong>
<span class="vendedor">
<span>
<img alt="" src="/i.php?w=148&h=60&src=uploads/clientes/2659aa7030bac6f245852b948187188a.jpg"></img>
</span>
</span>
</a>
<input class="comparacao" type="checkbox" name="comparacao[159695]" value="159695"></input>
$dom = new DOMDocument();
@$dom->loadHTML($content);
$xpath = new DOMXPath($dom);
$classname = "item";
$nodes = $xpath->query("//*[@class='" . $classname . "']");
foreach ($nodes as $node) {
echo $node->nodeValue . " <br> ";
}
Com o código acima, consigo obter apenas o seguinte resultado:
HONDA CG 150 2008 TITAN - KS GASOLINA R$ 4.500,00
Eu preciso também pegar as tags a.
<img><span><strong>
dentro de<a>
?$node->attributes
?Catchable fatal error: Object of class DOMNamedNodeMap could not be converted to string