title: Unable to get table data from a html page
body: <p>I am trying to get some data fields in a table in a html webpage. The webpage is dynamically generated on posting some content. I am using <code>php-curl</code> to get the web page and then <code>xpath</code> to get the data from some fields. I am able to get the page not the specific fields. The code looks like this</p>
  
  <pre><code>$url="http://www.rtu.ac.in/results/reformat.php";
  $post="rollnumber=08epccs060&amp;filename=fetchmodulesem_4_btech410m.php&amp;button=Submit";
  $ch=curl_init();
  curl_setopt($ch,CURLOPT_URL,$url);
  curl_setopt($ch,CURLOPT_POST,1);
  curl_setopt($ch,CURLOPT_POSTFIELDS,$post);
  curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
  curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  $content=curl_exec($ch);
  curl_close($ch);
  
  $totalPath="html/body/table[4]/tbody/tr[3]/td[4]";
  $page=new DOMDocument();
  $xpath=new DOMXPath($page);
  $page-&gt;loadHTML($content);
  $page-&gt;saveHTML();  // this shows the page contents
  
  $total=$xpath-&gt;query($totalPath);
  echo $total-&gt;length;    //shows 0
  echo $total-&gt;item(0)-&gt;nodeValue;   //shows nothing
  </code></pre>
  
  <p>The <code>xpath</code> is correct as I have checked it with <code>FirePath</code>. What I understand from this is that <code>$xpath-&gt;query</code> is not doing is job.</p>