"Tony Lewis" <[EMAIL PROTECTED]> writes:

> wget
> http://www.custsite.com/some/page.html --http-user=USER --http-passwd=PASS
>
> If you supply your user ID and password via a web form, it will be
> tricky (if not impossible) because wget doesn't POST forms (unless
> someone added that option while I wasn't looking. :-)

Wget 1.9 can send POST data.

But there's a simpler way to handle web sites that use cookies for
authorization: make Wget use the site's own cookie.  Export cookies as
explained in the manual, and specify:

wget --load-cookies=COOKIE-FILE http://...

Here is an excerpt from the manual section that explains how to export
cookies.

`--load-cookies FILE'
     Load cookies from FILE before the first HTTP retrieval.  FILE is a
     textual file in the format originally used by Netscape's
     `cookies.txt' file.

     You will typically use this option when mirroring sites that
     require that you be logged in to access some or all of their
     content.  The login process typically works by the web server
     issuing an HTTP cookie upon receiving and verifying your
     credentials.  The cookie is then resent by the browser when
     accessing that part of the site, and so proves your identity.

     Mirroring such a site requires Wget to send the same cookies your
     browser sends when communicating with the site.  This is achieved
     by `--load-cookies'--simply point Wget to the location of the
     `cookies.txt' file, and it will send the same cookies your browser
     would send in the same situation.  Different browsers keep textual
     cookie files in different locations:

    Netscape 4.x.
          The cookies are in `~/.netscape/cookies.txt'.

    Mozilla and Netscape 6.x.
          Mozilla's cookie file is also named `cookies.txt', located
          somewhere under `~/.mozilla', in the directory of your
          profile.  The full path usually ends up looking somewhat like
          `~/.mozilla/default/SOME-WEIRD-STRING/cookies.txt'.

    Internet Explorer.
          You can produce a cookie file Wget can use by using the File
          menu, Import and Export, Export Cookies.  This has been
          tested with Internet Explorer 5; it is not guaranteed to work
          with earlier versions.

    Other browsers.
          If you are using a different browser to create your cookies,
          `--load-cookies' will only work if you can locate or produce a
          cookie file in the Netscape format that Wget expects.

     If you cannot use `--load-cookies', there might still be an
     alternative.  If your browser supports a "cookie manager", you can
     use it to view the cookies used when accessing the site you're
     mirroring.  Write down the name and value of the cookie, and
     manually instruct Wget to send those cookies, bypassing the
     "official" cookie support:

          wget --cookies=off --header "Cookie: NAME=VALUE"


Reply via email to