Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Call a webpage and archive it's contents

Status
Not open for further replies.

basball

Technical User
Joined
Dec 18, 2002
Messages
192
Location
US
I want to be able to (from a client) machine go to a webpage and archive it's data and pull it back to my webserver for archiving. If the webpage has that I'm archiving has images, I also want to save those images
to machine locally as well. I will only be going to
one specific page.

A primer would be helpful. I think the challenge, is how to deal with images that I want to store locally. Any help would be appreciated.
 
To be honest, were I needing to do this, I wouldn't make myself crazy trying to do this through PHP. I'd just install some site ripper (go a Google search of the term '"site ripper" html' for a list of links)


If you find it necessary to do this in PHP, you'll have to (of course) first download a page. Depending on your system, you can use PHP's cURL family of functions, socket family of functions or fopen() to fetch the page.

Then you'll have to maintain a list of every <A> tag and their "href" attributes so that you can visit those pages later.

Then you'll have to maintain a list of every <IMG> tag and their "src" attributes so that you can fetch those. Again, you can use cURL, sockets, or fopen() for this.




Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I will actually be archiving pages from an auction site, however the user from his client machine as he is using
my webpage, will dictate what pages are archived from ~
any number of sites.

do you still recommend using a site ripper, i need to automate this process on an as needed basis.
 
I'd just look for a site ripper that can be invoked with command-line options.

Your PHP site could then invoke the ripper, passing the necessary command-line arguments.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top