Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Perl Script to login to a secure WebSite

by Anonymous Monk
on Jun 26, 2013 at 11:20 UTC ( #1040753=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Perl Script to login to a secure WebSite
in thread Perl Script to login to a secure WebSite

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&ltmpl=de +fault&ltmplcache=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);
----------------------------------------------------------- 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.K


Comment on Re^3: Perl Script to login to a secure WebSite
Download Code
Reaped: Re^4: Perl Script to login to a secure WebSite
by NodeReaper (Curate) on Jun 26, 2013 at 11:54 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040753]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2015-07-03 07:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (48 votes), past polls