title: Why isnt php xpath working on this site?
body: <p>I have this simple php code to print out all the links on a specific page on Agoda.com. However, for some reason the xpath is not detecting any html to query. Does anyone know why xpath wouldnt work on this site and how I can fix it?: </p>
  
  <pre><code>$url="http://www.agoda.com/world.html";
  $html=file_get_contents($url);
  
  
  $dom = new DOMDocument();
  @$dom-&gt;loadHTML($html);
  $xpath0 = new DOMXPath($dom);
  $locs = $xpath0-&gt;evaluate("//a");
  
  
  for ($x = 0; $x &lt; 20; $x++) {
  
  $location=$locs-&gt;item($x)-&gt;nodeValue;
  $locationurl="http://www.agoda.com".$locs-&gt;item($x)-&gt;getAttribute('href');
  
  print("$x. $location,$locationurl&lt;br /&gt;");
  }   
  </code></pre>