[lug] Stupid WGET question

Matt Thompson thompsma at jilau1.colorado.edu
Thu Feb 17 08:23:20 MST 2005


On Wed, 2005-02-16 at 17:11 -0700, George Sexton wrote:
> Anyone know how to have wget retrieve non-HTML files when it traverses an
> HTML page?
> 
> For example, I have an HTML page that has links to iCal files on it. I want
> WGET to retrieve the .HTML file, and all .ICS files referenced from that
> page.
> 
> Here's the URL:
> 
> http://www.mhsoftware.com/caldemo/iCal.html

Hmm...there might be a way to do this, but you'll probably have to
fiddle around to get what you need.  For example, if you need to get
the .css files for the .html page, you'd have to grab those too.

The way I might do it is:

wget --mirror -A{.ics,.html} http://...

This should go through the entire tree and grab every .ics and .html
file preserving directory structure.  I think.  Try it and see, I guess.
You can use -A and -R to accept/reject file extensions if you need
more/less.

HTH,
Matt

-- 
Learning just means you were wrong and they were right. - Aram
   Matt Thompson -- http://ucsub.colorado.edu/~thompsma/
   440 UCB, Boulder, CO  80309-0440
   JILA A510, 303-492-4662




More information about the LUG mailing list