Hi Gedanken,
Thanks again for your help. I put in the line that sets the cookie and I looked at the hmtl and found a number to put in the some-crazy-number field, but I guess it was the wrong number. I cut out all the other stuff in my program to make it simpler and here is a copy so you can see the whole thing.
Thanks again.
Joe.
[Abba:~/oldperlcode] josephal% lite
1. http://pr.retire.americanfunds.com
2. http://pr.retire.americanfunds.com/incompatible.html
[Abba:~/oldperlcode] josephal% cat lite
#!/usr/bin/env perl
# americanfunds - downloads account info from american funds 401k website
#
use strict;
use warnings;
use WWW::Mechanize;
use HTML::TreeBuilder;
use HTML::TableExtract;
use Data::Dumper;
$Data::Dumper::Terse = 1;
my $m = WWW::Mechanize->new( autocheck => 1); $m->agent_alias( 'Windows IE 6' );
main('12345678', '123456');
sub main
{
my ($id, $pass) = @_;
$m->get('http://www.americanfunds.com/retire'), or die "can't get initial americanfunds.com/retire screen";
$m->cookie_jar()->set_cookie(1, "AnalysisUserID", "1078445853225", "/", "pr.retire.americanfunds.com");
my $str = $m->base; print "1. $str\n";
$m->follow_link(n => 1 ) or die "can't get login screen";
$str = $m->base; print "2. $str\n";
exit;
# # simulate logging in with TIN/PIN #
$m->submit_form(
form_name => 'login',
fields => {
partssn => $id,
partpin => $pass,
},
) or die "can't login";
}
[Abba:~/oldperlcode] josephal%