Results 1 to 3 of 3
Thread: Taking snapshot using PHP
Feb 19, 2005, 05:59 #1
Taking snapshot using PHP
I want take a snap shot of any website dynamically using PHP. Is it possible in PHP? If possible then would you like to tell me the steps?
Feb 19, 2005, 06:42 #2
Feb 19, 2005, 18:25 #3
- Join Date
- Dec 2004
- 0 Post(s)
- 0 Thread(s)
There are programs for this, check out google, but you can do this with php.
The general steps should look like this:
- Get the pages starting from a page, like homepage. using curl
- Parse the html file. Parse all the links. Check out PEAR for parsing HTML pages. There are couple of classes to parse HTML pages there.
- Start visiting and parsing links from each link at the homepage. Remember the links you have visited. While you visit those pages and retrieve the files, to take a "snapshot" you need to change the links so that you can view pages locally. i.e. change /css/site.css into ../css/site.css for the pages one level down the root level.
It is quite tricky to do all of these, so I would recommend to take a look at the existing programs which solve this problem.