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

Hi,

I have the task to make Html Pages offline available, so I yust wondered if there is a Modul (searched CPAN allready, but do not found anything) or simple way to do such a thing.
The complete task would be to save the Page alongside with a depth of links and this in "pure" perl. Also suggestions, on how to do this, would be appreciated.

Humble,

Andre

Replies are listed 'Best First'.
Re: Making Html Pages offline available
by friedo (Prior) on Sep 18, 2006 at 16:43 UTC
    Why not just use wget? There's a version available for every common OS.
Re: Making Html Pages offline available
by chargrill (Parson) on Sep 18, 2006 at 18:25 UTC

    You can also try WWW::Mechanize if you really need to do it in Perl.



    --chargrill
    s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)
Re: Making Html Pages offline available
by brian_d_foy (Abbot) on Sep 18, 2006 at 21:00 UTC

    I use my webreaper script to download entire websites that I want to view offline. It's pure Perl. I don't have a feature to stop at a certain level, though. It also doesn't do any link re-writing for those sites that like to use absolute URLs everywhere.

    As mentioned earlier, wget can handle this too. It's -r feature recursively downloads a site, and -l sets the desired depth (5 being the default). Here's the example from its documentation:

    wget -r -l2 -P/tmp ftp://wuarchive.wustl.edu/

    Neither of those support javascript though.

    --
    brian d foy <brian@stonehenge.com>
    Subscribe to The Perl Review
Re: Making Html Pages offline available
by Anonymous Monk on Sep 19, 2006 at 04:29 UTC