DOMXPath$html->query('//p[@class="myclass"]/a')->item(0);
が機能していません。
HTMLは次のとおりです。
<p class="username">
<img src="http://static1.tryal.com/img/b.gif" onclick="lalalaa()" class="a12s_iYblt4hN_DkIt_GoiyOtu8 opsi" />
<b>
<a href="/about"><b>Lalala.</b></a>
</b>
</p>
$name = $html->query('//p[@class="username"]/a')->item(0)->nodeValue;
//This doesn't return the name "Lalala.";
$name = $html->query('//p[@class="username"]')->item(0)->nodeValue;
//This works just fine.
なぜこの木が機能しないのですか?私はそれを間違って入力していますか?
事前にどうもありがとうございました。