I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-06-27 11:33:00-07 by jgormley
Help with Login Script - Input type image
I can't figure out why this is not working... It is a login page where it is submitted by the on_click of a input field of type image. If this example could get "Your username or password is incorrect." in the response... Then it should work with a valid login... Any help would be greatly appreciated....
#!/usr/bin/perl use warnings; use strict; use WWW::Mechanize; my $username = 'fakename'; my $password = 'fakepassword'; my $url = 'http://www.betterinvesting.org/Members'; my $mech = WWW::Mechanize->new(autocheck => 1); $mech->get( $url ); $mech->form_name("aspnetForm"); $mech->field('ct100$ContentPlaceHolder1$UserName', $username); $mech->field('ct100$ContentPlaceHolder1$Password', $password); $mech->click('ctl00$ContentPlaceHolder1$LoginButton'); print $mech->content();
Direct Responses: 11067 | Write a response
Posted on 2009-06-28 01:22:21-07 by jgormley in response to 11066
Re: Help with Login Script - Input type image
I figured it out.... Here is the code that I got to work... in case someone needs it..
#!/usr/bin/perl use warnings; use strict; use WWW::Mechanize; my $username = 'fakename'; my $password = 'fakepassword'; my $LoginUrl = 'http://www.betterinvesting.org/Members'; my $ticker = 'ibm'; my $ExpUrl = "http://tools.betterinvesting.org/CR/Expanded.aspx?ticker=$ticker"; my $mech = WWW::Mechanize->new(autocheck => 1); $mech->get( $LoginUrl ); $mech->form_name("aspnetForm"); $mech->set_visible( $username, $password ) ; $mech->click('ctl00$ContentPlaceHolder1$LoginButton');
Direct Responses: Write a response