php include domhtml php page file_get_contents http www google com sea

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<?php
include './domhtml.php';
$page = file_get_contents('http://www.google.com/search?hl=ru&q=Jeck');
$doc = new DOMHtml;
$doc->loadHTML($page, 'UTF-8');
$xpath = new DOMXPath($doc);
$nodes = $xpath->query("//h3[@class='r']/a/@href[starts-with(., 'http://')]");
foreach ($nodes as $node) {
echo $node->nodeValue."\r\n";
}
?>