Hi Guys,

Yet again, I was wondering if one of you genious's could help me. I want to be able to take a screenshot of an entire webpage (From the header to footer) using a PHP script. So If I crawled the webpage

URL = http://www.google.co.uk/search?q=php+sc ... =en&num=10

I would like to take a screenshot of that entire page from the GOOGLE header to the GOOGLE footer and store it into a TEMPORARY folder on my server and then be able to call it back.

Is this possible? I've been searching everywhere for a solution to this but the closest thing I came to was http://mistonline.in/wp/get-youtube-vid ... avascript/

I would be really grateful if one of you could please help me, thank you in advance.

M

    you cant with php, you could use it to call an external program to do it. Doing this on google (and probably quite a few other sites) in your example above is a breach of there terms and conditions.

      3 months later

      Don't mean to revive a dead thread but figured this could be useful to someone who is looking to automate screen shots in PHP.

      The only thing is that this script has to be run on a windows machine as it uses COM objects to open and close Internet Explorer.

      <?php
      $browser = new COM("InternetExplorer.Application");
      $handle = $browser->HWND;
      $browser->Visible = true;
      $browser->Fullscreen = true;
      $browser->Navigate("http://www.google.com");
      
      /* Still working? */
      while ($browser->Busy) {
          com_message_pump(4000);
      }
      $im = imagegrabwindow($handle, 0);
      $browser->Quit();
      imagepng($im, "google_screenshot.png");
      imagedestroy($im);
      ?>
      

        neat, i'm so used to using *.nix COM never occurred to me.

          Write a Reply...