cesarcesar
08-10-2007, 06:20 AM
i want to do a screen capture/scrape of a page, resulting in a JPG or PNG that i could save in a dir of my choice. This capture needs to take place a few seconds after the page loads, to allow all JavaScript and Flash elements on page to load.
It would be great if i could also/just target a specific JS or Flash element to grab, instead of the whole page. There has to be some great PHP solutions for this.
Thanks, Cesar
PappaJohn
08-10-2007, 06:44 AM
Well, php is a server-side language, meaning that all processing takes place on the server before the page is ever sent to the browser. Therefore, php cannot wait a few seconds after the page has loaded to perform any functions.
cesarcesar
08-10-2007, 06:55 AM
there has to be some type of server-side scripts and modules that can render a page server-side.
sitevista.com does it... why cant I?
i have to be able to load a page in the background. possibly load it into cache first. HTML to PDF conversion scripts do it... sorta somewhat.
why don't you make the php script and run an ajax function on a page when it loads that goes to that script and takes a screenshot and saves the image??
cesarcesar
08-10-2007, 09:24 AM
screen shot using what program or scripts. PHP has only windows screen capture.
<?php
$im = imagegrabscreen();
imagepng($im, "myscreenshot.png");
?>
that works but only in windows and with a special handler, no doubt you can do it in javascript or if you know java it might, but I haven't used java before so i don't know.
have a look at this site, it looks like u need to use javascript and java
http://www.itjungle.com/mpo/mpo062002-story01.html
StupidRalph
08-11-2007, 11:29 AM
I was totally unaware of that function, I asked the same question a few years ago. Have a look at this thread. :)
http://www.codingforums.com/showthread.php?t=79721