jclh has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -wd use strict; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $response = $mech->get( "https://secure.ancestry.com/login" ); $mech->submit_form( form_number => 1, fields => { Username => 'MyUserName', Password => 'MyPassword', ReturnUrl => '' }, ); print $response->as_string( );
mech-dump https://secure.ancestry.com/login shows the form to look like this:
POST https://secure.ancestry.com/Login
Username= (text)
Password= (password)
ReturnUrl= (hidden readonly)
I think my confusion may be that I don't know what to do with the 'ReturnUrl' field so (I believe) I'm passing it back a null entry...
Anyway, each time I run it the server gives back a standard 'unknown user/pass' page...
I've double/triple checked my user/pass is correct.
Anyone have any ideas on this one?
Thank you!
JclH
Update
Thank you guys for the replies. Not sure which one, but one of the suggestions seems to have worked. Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize authentication problem
by Anonymous Monk on Jun 03, 2013 at 05:08 UTC | |
|
Re: WWW::Mechanize authentication problem
by runrig (Abbot) on Jun 03, 2013 at 17:09 UTC |