I want to grab name and coordinates of places from advisor.travel web site which content is CC so I need only first 10 page with name and coordinates...
Link to attractions is link format: http://en.advisor.travel/poi/1 so 'http://en.advisor.travel/poi/'.i where i is number of attraction
I want to get only first 10 attraction so i is beetween 1 and 10 and xpath for name is
//h1 tag
and xpath for coordinates is:
//span[@class='latitude']
//span[@class='longitude']
I now create a scraper and code is :
<?php
for ($i=0; $i<=10; $i++)
  {
  $dom2 = new DOMDocument();
  @$dom2->loadHTMLFile('http://en.advisor.travel' . $i);
  $xpath2 = new DOMXPath($dom2);
  $data = array();
  $data[name] = $xpath2->query("//h1");
  $data[latitude] = $xpath2->query("//span[@class='latitude']");
  $data[longitude] = $xpath2->query("//span[@class='longitude']");
  } 
echo '<pre>' . print_r($data, true) . '</pre>';
?>
but this code for result give me only this:
Array
(
    [name] => DOMNodeList Object
        (
            [length] => 0
        )
    [latitude] => DOMNodeList Object
        (
            [length] => 0
        )
    [longitude] => DOMNodeList Object
        (
            [length] => 0
        )
)       
So how I can fix it? What is problem here?