Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Login to gmail using WWW::Mechanize::Firefox

by samir_gambler (Novice)
on May 06, 2013 at 18:25 UTC ( [id://1032363]=perlquestion: print w/replies, xml ) Need Help??

samir_gambler has asked for the wisdom of the Perl Monks concerning the following question:

I am new to perl. Can any one please share a code snippet to login to gmail using WWW::Mechanize::Firefox. Thanks in Advance.
  • Comment on Login to gmail using WWW::Mechanize::Firefox

Replies are listed 'Best First'.
Re: Login to gmail using WWW::Mechanize::Firefox
by marto (Cardinal) on May 06, 2013 at 18:34 UTC

    What are you trying to achieve by automating gmail via a browser?

      well Nothing specific right now. I am just trying to learn WWW::Mechanize::Firefox and explore the possibility with it. Thanks in Advance
Re: Login to gmail using WWW::Mechanize::Firefox
by samir_gambler (Novice) on May 07, 2013 at 08:05 UTC
    I tried to login using this script but i am getting error
    use WWW::Mechanize::Firefox; my $mech = WWW::Mechanize::Firefox->new( activate => 1, autoclose => 0,); my $url = "https://accounts.google.com/Login"; $mech->get($url); $result = $mech->submit_form( form_id => 'gaia_loginform', fields => { Email => 'xxxx@gmail.com', # name of the input field and value Passwd => 'xxx', } ,button => 'signIn' #name of the submit button ); print $result->content();
    On running the script I get the error No form found to submit. at gmail.pl line 12. Can any one please look at the issue. Thanks in advance

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-25 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found