everlast88az has asked for the wisdom of the Perl Monks concerning the following question:
Which is not what I want. Any ideas why I am getting this rather than an html page??use WWW::Mechanize; use HTTP::Cookies; my $outfile = "out.htm"; my $url = "***************"; my $username = "**********"; my $password = "********"; my $mech = WWW::Mechanize->new(); my $number = 2; $mech->cookie_jar(HTTP::Cookies->new()); $mech->get($url); my @names = $mech->forms(); #print @names; #mech->form_id( $name ); $mech->form_name('login_form'); #$mech->form_number($number); $mech->field(USER => $username); $mech->field(PASSWORD => $password); $mech->submit(); my $output_page = $mech->content(); print $output_page; @links = $mech->find_all_links(); foreach (@links) { print $_->url(), "\n"; print $_->text(), "\n"; print $_->name(), "\n"; print $_->tag(), "\n"; } This gives::: <!-- --> <script language="Javascript"> loc = document.URL; begin_target = loc.indexOf("TARGET="); end_target = loc.length; target = loc.substring(begin_target + 7,end_target); target = target.replace(":80",""); target = target.replace('$SM$', ''); end_site = target.indexOf('/',10); site = target.substring(0,end_site); if(end_site == -1) { end_site = target.indexOf('%2f',16); } site = target.substring(0,end_site); while( (site.indexOf('%3a')) != -1) { site = site.replace('%3a', ':'); } while( (site.indexOf('%2f')) != -1) { site = site.replace('%2f', '/'); } while( (site.indexOf('%2e')) != -1) { site = site.replace('%2e', '.'); } document.location.href = site + "/?DEST=" + target; </script>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: form logins
by bilfurd (Hermit) on Apr 06, 2009 at 01:58 UTC | |
by Anonymous Monk on Apr 06, 2009 at 02:13 UTC | |
by tilly (Archbishop) on Apr 06, 2009 at 05:27 UTC | |
|
Re: form logins
by moritz (Cardinal) on Apr 06, 2009 at 06:32 UTC | |
by hacker_j99 (Beadle) on Apr 06, 2009 at 06:49 UTC |