$mech->submit_form( form_number => 1, fields => { 'password' => $self->{password} }, ); #### $mech->submit_form( form_name => 'login', fields => { 'input-login-email' => $self->{account}, 'password' => $self->{password} }, ); #### if ($self->{location} eq 'us'){ login_us($self) unless $self->{logged_in}; $mech->get('https://s1.amazon.com/exec/varzea/subst/your-account/manage-your-seller-account.html/ref=ya_hp_az_2/'); } elsif ($self->{location} eq 'uk'){ login_uk($self) unless $self->{logged_in}; $mech->get('http://s1.amazon.co.uk/exec/varzea/subst/your-account/manage-your-seller-account.html/ref=ya_hp_az_2/'); } $mech->follow_link(text_regex => qr/View your Amazon Payments account and billing history/i); $mech->follow_link(text_regex => qr/View your Amazon Payments account summary/i); $mech->submit_form( form_number => 1, fields => { 'password' => $self->{password} }, ); $mech->follow_link(url_regex => qr/vg=1&ve=6&vf=4/i); sub login_us{ my $self = shift; print "Performing US LOGIN...\n"; $mech->get('http://www.amazon.com/'); $mech->follow_link(text_regex => qr/your account/i); $mech->follow_link(text_regex => qr/Your seller account/i); $mech->submit_form( form_name => 'login', fields => { 'input-login-email' => $self->{account}, 'password' => $self->{password} }, ); $self->{logged_in} = 1; return $mech->content(base_href => [undef]); }