webreaper [OPTIONS] URL
The webreaper program downloads web sites. It creates a directory, named after the host of the URL given on the command line, in the current working directory, and will optionally create a tarball of it.
Getting around web site misfeatures
This script has many features to make it look like a normal, interaction web browser. You can set values for some features, or use the defaults, enumerated later.
Set the referer [sic] string. Some sites limit what you can see based on how they think you got to the address (i.e. they want you to click on a certain link). The script automatically sets the referer strings for links it finds in web pages, but you can set the referer for the first link (the one you specify on the command line) with the -r switch.
Basic browser features
For websites that use a login and password, use the -u and -p switches. This feature is still a bit broken because it sends the authorization string for every address.
Watch the action by turning on verbose messages with the -v switch. If you run this script from another script, cron, or some other automated method, you probably want no output, so do not use -v. You can also set the WEBREAPER_VERBOSE environment variable.
To get even more output, use the -d switch to turn on debugging output. You can also set the WEBREAPER_DEBUG varaible.
You can create a single file of everything that you download by creating an archive with the -t switch, which creates a tarball.
The script limits its traversal to URLs below the starting URL. This may change in the future.
Command line switches
set the user agent string
list of file extensions to store (not yet implemented)
list of file extensions to skip (not yet implemented)
turn on debugging output
use this directory for downloads
store all files in the same directory (flat)
allowed hosts, comma separated.
stop after requesting NUMBER resources, whether or not webreaper stored them
stop after storing NUMBER resources
referer for the first URL
password for basic auth
sleep between requests
create tar archive
username for basic auth
create a zip archive