#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; use HTTP::Cookies; use LWP::Simple qw(getstore); #use LWP::Debug qw(+ -conns); ###Field values my $fname = 'john'; my $lname = 'smith'; my $login = 'testc.c.c.testc'; my $password = 'testtestc'; my $question = 'What is your primary frequent flyer number'; my $answer = 'my answer is the best answer'; my $google_captcha = ''; ###Setup WWW::Mechanize my $google = WWW::Mechanize->new(); $google->add_header( 'Accept-Encoding' => 'text/html' ); ###Start print "Fetching captcha image...\n"; $google->get('http://mail.google.com/mail/signup'); my @forms = $google->form_number(0); getstore($google->value("newaccounturl"),'create_google_captcha.jpg'); print "image download (create_google_captcha.jpg)\n\nEnter captcha word: "; $google_captcha = <>; chomp($google_captcha); $google->field("FirstName", $fname); $google->field("LastName", $lname); $google->field("Email", $login); $google->field("Passwd", $password); $google->field("PasswdAgain", $password); $google->field("selection", $question); $google->field("IdentityAnswer", $answer); $google->field("newaccountcaptcha", $google_captcha); $google->untick('PersistentCookie', "yes"); $google->untick('smhck', 1); $google->click_button(name => "submitbutton"); ###Output result open (out,'>page.html'); print out $google->content(); close (out); exit;
In reply to WWW::Mechanize cannot create new gmail account by gontham
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |