telcontar has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I have been wondering whether there is a Perl module that provides functionality somewhat similar to modern browsers' "Save as" function- to save a local copy of a HTML file, including any images, objects, applets, etc.

I imagine that this would require the module to save everything on a given location on the filesystem, and to change any attributes like <img src="..."> to be changed to reflect that location.

Does anyone know about a module that provides this or similar functionality? I've tried looking on CPAN, but couldn't find anything.

Thanks,
John

Replies are listed 'Best First'.
Re: module to "save as" HTML files
by gam3 (Curate) on Apr 11, 2005 at 11:21 UTC
    Try lwp-rget in LWP.

    -- gam3
    A picture is worth a thousand words, but takes 200K.
Re: module to "save as" HTML files
by ghenry (Vicar) on Apr 11, 2005 at 13:05 UTC

    Could you explain a little more about the environment you want this to be in?

    Scripted on the commandline or part of an application etc.?

    And whether you actually mean mirroring a website/webpage.

    Thanks.

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!
      Hi,

      it'd probably be a perl module invoked from within a web application. It's not meant to mirroring a website / webpage, just to save a "local copy" of a single html site for future reference. The web application is meant to analyze parts of the html code and give some results; and it should keep a local copy of the page it analyzed and of the report it generates, because web content may change at any time. So the web application can say "this is a report on our results on this web page, and this is what the page looked like (or: This is the web page's code) at the time we analyzed it".

      John