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?
In reply to form not being filled out by WWW::Mechanize by Special_K
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |