Special_K has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I'm trying to use WWW::Mechanize to interact with a website. I'm having trouble getting past the username/password screen, however. Here is what I have:
#!/usr/bin/perl -w use strict; use WWW::Mechanize; my $m = WWW::Mechanize->new(); $m->agent_alias('Linux Mozilla'); $m->get('http://alumni.nd.edu/s/1210/start.aspx?sid=1210&gid=1&pgid=3& +cid=40'); printf("%s\n", $m->title()); $m->dump_forms(); $response = $m->submit_form( form_number => 1, fields => { 'cid_40$txtUsername' => '<username>', 'cid_40$txtPassword' => '<password>', } ); die unless ($m->success); #printf("response message is %s\n", $response->message); printf("%s\n", $m->title());
I receive a response of "OK" from the web server when I run the script, yet the title of the page hasn't changed, indicating to me that the username and password fields aren't being filled out. Given the content returned by $m->dump_forms(), am I filling out the username and password fields correctly? What else should I check for?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: form not being filled out by WWW::Mechanize
by roboticus (Chancellor) on Mar 12, 2013 at 15:00 UTC | |
|
Re: form not being filled out by WWW::Mechanize
by locked_user sundialsvc4 (Abbot) on Mar 12, 2013 at 17:18 UTC | |
by Special_K (Pilgrim) on Mar 13, 2013 at 03:39 UTC | |
by Anonymous Monk on Jul 27, 2013 at 08:49 UTC | |
by Anonymous Monk on Sep 26, 2013 at 22:24 UTC |