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