title: Use Selenium code to download Web page
body: <p>I have installed Selenium IDE on Firefox and manage to record and play various web navigation sequences. What I need is to do it all automated through PHP, i.e. run a PHP script which gets the HTML source of the final page (i.e. at end of navigation sequence).
  Within Selenium there is an option to export to PHP, so I get something like:</p>
  
  <pre><code>class Example extends PHPUnit_Extensions_SeleniumTestCase
  {
    function setUp()
    {
      $this-&gt;setBrowser("*chrome");
      $this-&gt;setBrowserUrl("http://www.example.com/");
    }
  
    function testMyTestCase()
    {
      $this-&gt;open("/");
      $this-&gt;click("link=24");
      $this-&gt;waitForPageToLoad("30000");
      $this-&gt;click("link=Test2");
      $this-&gt;waitForPageToLoad("30000");
      $this-&gt;click("//td[4]/a/img");
      $this-&gt;waitForPageToLoad("30000");
      $this-&gt;type("username", "user");
      $this-&gt;type("password", "pass");
      $this-&gt;click("//input[@name='login']");
      $this-&gt;waitForPageToLoad("30000");
    }
  }
  </code></pre>
  
  <p>Although I can use this in my PHP code, it doesn't seem to do anything (since it's just a class definition I guess). How do I get that last source page? Note that I do not want my PHP code to do the navigation on screen, instead I would then like to process that final source code further within PHP.</p>