Topic awaiting preservation: Screen Capture |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: Gainesboro, TN, USA |
posted 07-24-2005 06:22
Is there a way to have a PHP script take an URL and capture the look of the site? |
Paranoid (IV) Inmate From: France |
posted 07-24-2005 11:26
Not really, since what you want is the result produced the rendering engine of the browser which is obviously on Client Side and out of reach of a Server Side language. However, depending on what you really want to do, if it's a one shot usage, you could have a look at Rendering Web Page To Images using the canvas element that has recently been implemented in Gecko 1.8. It means that you must use either Deer Park ( the alpha previews of FireFox 1.1 or 1.5 ), or probably Mozilla 1.8b2. |
Paranoid (IV) Inmate From: Florida |
posted 07-24-2005 11:55
quote:
|
Bipolar (III) Inmate From: Gainesboro, TN, USA |
posted 07-24-2005 22:07
Thanks poi Always helpful. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 07-25-2005 01:42
It is not really PHP but I don't think you would have found a nice solution to do this with PHP it is just not the direction PHP travels in. PHP is more server side and this is a clientside thing. code: import ImageGrab from win32com.client import Dispatch from time import sleep page = "http://www.google.com" file = "C:\\test.jpg" ie = Dispatch("InternetExplorer.Application") ie.Visible = 1 ie.Navigate(page) if ie.Busy: sleep(2) ImageGrab.grab().save(file)
|
Paranoid (IV) Inmate From: Florida |
posted 07-25-2005 04:46
quote:
Then I'd have a screenshot of what http://ozoneasylum.com/ looks like in Firefox. |
Maniac (V) Inmate From: Sthlm, Sweden |
posted 07-25-2005 07:35
I agree with reiso here, there is nothing to stop you from scheduling a script to run through a list of sites, let php use some native commands "under the hood" to open, screencap and save the site. |
Bipolar (III) Inmate From: Gainesboro, TN, USA |
posted 07-25-2005 22:20
Thanks all, it's appreciated. I knew about opening up a browser on the server, but not enough of them out there have the prerequisites to do it. |
Paranoid (IV) Inmate From: Florida |
posted 07-25-2005 22:44
Don't worry about it. |
Bipolar (III) Inmate From: Gainesboro, TN, USA |
posted 07-26-2005 05:08
Hey reisio, thanks. |
Bipolar (III) Inmate From: övik |
posted 07-26-2005 17:22
You can do it sorta, if you test this approach. |