in reply to Re^2: Perl Script to login to a secure WebSite
in thread Perl Script to login to a secure WebSite
----------------------------------------------------------- Very thanks for the above script. After once logged in to the gmail I would like display output like "Log in successful", if log in fails I would like to display "Log in fail"; Please help me on the above condition. Thanks, you Jineesh.Kuse strict; use warnings; use strict; use WWW::Mechanize; use HTTP::Cookies; my $outfile = "out2.htm"; my $url = "https://accounts.google.com/ServiceLogin?service=mail&passi +ve=true&rm=false&continue=http://mail.google.com/mail/&scc=1<mpl=de +fault<mplcache=2"; my $username = 'yourgmailid'; my $password = 'yourpasswrd'; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get($url); $mech->form_id('gaia_loginform'); $mech->field("Email", $username); $mech->field("Passwd", $password); $mech->click; my $output_page = $mech->content(); print $output_page; open(OUTFILE, ">$outfile"); binmode(OUTFILE, ":utf8"); print OUTFILE "$output_page"; close(OUTFILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl Script to login to a secure WebSite
by Anonymous Monk on Oct 22, 2016 at 12:14 UTC | |
by Corion (Patriarch) on Oct 22, 2016 at 12:23 UTC | |
by Anonymous Monk on Oct 22, 2016 at 13:36 UTC | |
by Corion (Patriarch) on Oct 22, 2016 at 13:50 UTC |