An alternate method would be just to tell Netscape to do it for you via
an AppleScript.
I wrote this as part of a Perl script to copy mail out of my Yahoo! Mail
account. Since Yahoo! needed cookies, logins, etc. to get the page I
figured I'd just let Navigator handle it. I start Netscape, log into my
Yahoo! Mail account and then run the Perl. As far as Yahoo! knows I
just type in my browser fast.
There can be some synchronization problems since the script returns to
processing before the page finishes saving, and you still have to go get
any images/et-al, but you get the idea.
# Get HTML page
# Use AppleScript to access Netscape to do the download
# because the Yahoo Mail needs the response of a cookie
# for login confirmation.
sub getPage {
my ($URLname, $filename) = @_;
print "Saving page $URLname\ninto file $filename\n";
MacPerl::DoAppleScript(<<"END_SCRIPT");
tell application "Netscape Communicatorª"
activate
GetURL "$URLname" to file "$filename"
end tell
END_SCRIPT
}