jineesh135 has asked for the wisdom of the Perl Monks concerning the following question:
use 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 = '<user>'; my $password = '<password>'; 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);
I got the above script from this website. It is really helpful for me. In the above condition it is log in to the gmail but it not says log in was success of fail.
I would like to display after execution of the above script, If log in success "Logged in successfully", or if fails it should display "Log in failed".
Please help me on the above condition.
Thank you,
Jineesh.K
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Login to the URL
by ww (Archbishop) on Jun 26, 2013 at 15:13 UTC |