title: PHP: Getting Final Rendered HTML of a Remote Site
body: <p>Lets say there's a HTML page with following code in it - </p>
  
  <pre><code>&lt;body&gt;
    &lt;div id='some_id'&gt;&lt;/div&gt;
    &lt;script&gt;
       var div = document.getElementById("some_id");
       var input = document.createElement("input");
       input.type="text";     
       input.value="text box";
       div.appendChild(input); 
   &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Now if I do View-source, I will see this above code. But If I use a firebug, I will see this - </p>
  
  <pre><code>&lt;body&gt;
    &lt;div id='some_id'&gt;&lt;input type="text"&gt;&lt;/div&gt;
    &lt;script&gt;
       var div = document.getElementById("some_id");
       var input = document.createElement("input");
       input.type="text";     
       input.value="text box";
       div.appendChild(input); 
   &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>That is, the final rendered HTML output is different. Lets assume this file is on another server like - <a href="http://www.someanotherserver.com/some_file.html" rel="nofollow">http://www.someanotherserver.com/some_file.html</a></p>
  
  <p>Now is it possible in PHP to get the final rendered HTML output ? <code>file_get_contents</code> I guess will just show what I see in view-source.</p>