Using the xPath, how can I get the data inside this tag ?
<a href="/poker/?ca=v"> THIS </a>
This is the source code, I do not know if there is a need of getting the tree though
<div id="nav">
<ul id="someID">
<li><a href="/poker/?ca=v"> THIS </a></li>
</ul>
</div>
Thank you
UPDATE
here is my code
function extractNodeValue($query, $xPath, $attribute = null) {
$node = $xPath->query("//{$query}")->item(0);
if (!$node) {
return null;
}
return $attribute ? $node->getAttribute($attribute) : $node->nodeValue;
}
$document = new DOMDocument();
$document->loadHTML($html);
$xPath = new DOMXpath($document);
$name = extractNodeValue('//*[@id="row1"]',$xPath);
echo $name;