Plz let me know if follow_link(text => 'string') will work on this or do I need to use any other function... What happens when you T.I.T.S - Try It To See ?
| [reply] |
Hi,
After logging to the website, I am able to go the one more link in the next page.
Now I have to select the checkbox which enables few buttons (after selecting the checkbox).
Once button is enabled I need to click one of the button, which opens one form, I need to select one value from the drop down and submit.
Once this completes then I am done with all my steps..
Please suggest on this, here that site uses internally Java Script..
I tried to seclect checkbox, then button and then submit.. Script runs fine without any error but action is not performing... :(
Plz correct me if any wrong in the code..
$mech->tick( 'D:_ctl2:_ctl0', 'on');
#$mech->tick( "D:_ctl2:_ctl0" );
print $mech->success();
$mech->current_form()->find_input(undef, 'Assign');
print $mech->success();
$mech->field('K', 'Name1');
print $mech->success();
$mech->current_form()->find_input(undef, 'Update');
print $mech->success();
| [reply] [d/l] |
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 = '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
| [reply] [d/l] |
The code is executing well but the output which we are getting is in the html format , cannot we get the output in the gui , so that if at all we run the script the gmail account of ours will be automatically logged in,,??
| [reply] |
If you want to automate the login into gmail and then continue the session in a browser, you will either have to automate a browser, like Win32::IEAutomation or WWW::Mechanize::Firefox provides or you'll have to store the appropriate session variables in the cookies of the browser. There are various HTTP::Cookies modules that allow reading and writing the cookies of a browser.
| [reply] |