HTML Code:
<div id="webResults">
<div class="searchResult webResult">
<a class="resultTitle" data-icl-coi="540" data-icl-cop="results-main" href="http://www.link.com/">http://www.link.com</a>
<div class="resultDescription"></div>
<div class="resultDisplayUrl"></div>
</div>
PHP Code:
$html = file_get_contents(...);
$doc = new DOMDocument();
@$doc->loadHtml($html);
$x = new DOMXpath($doc);
foreach ($x->query("//div[@id='webResults']/div/a") as $value) {
echo "<a href=".$value->getAttribute("href").">".$value->getAttribute("href")."</a><br />";
}
Im trying to get the value of href... unsay sayup nko ani?..
your help will be greatly appreciated..
thanks..