Trying to send SMS from PC to Mobile but unable to select "Send Free SMS" button on the home page. Please help how to select options like "Send free SMS" or "Start earnings"after login. Please find the code below that I tried

use WWW::Mechanize; use Compress::Zlib; use HTML::TokeParser; my $mech = WWW::Mechanize->new(); my $username = ""; my $keyword = ""; my ($text,$mobile); my @mobilenos; my $morenos = $ARGV[0]; @mobilenos = $morenos; print @mobilenos; $text = $ARGV[1]; $deb = 1; print "Total Character of message is ".length($text)."\n" if($deb); $text = $text."\n\n\n\n\n" if(length($text) < 135); $mech->get("http://wwwl.way2sms.com/content/index.html"); unless($mech->success()) { print "successed"; exit; } $dest = $mech->response->content; print "Fetching...\n" if($deb); if($mech->response->header("Content-Encoding") eq "gzip") { $dest = Compress::Zlib::memGunzip($dest); $mech->update_html($dest); } $dest =~ s/<form name="loginForm"/<form action='..\/Login1.action' nam +e="loginForm"/ig; $mech->update_html($dest); $mech->form_with_fields(("username","password")); $mech->field("username",$username); $mech->field("password",$keyword); print "Loggin...\n" if($deb); $mech->submit_form(); $dest= $mech->response->content; $mech->click_button(value => "Send Free SMS"); foreach $mobile (@mobilenos){ chomp($mobile); print "\nMessage sending to ".($mobile)."\n"; print "Sending ... \n" if($deb); $mech->field("Mobile Number",$mobile); $mech->field("Message",$text); $mech->click(value => "Send SMS"); if($mech->success()) { print "Done \n" if($deb); } else { print "Failed \n" if($deb); exit; } $dest = $mech->response->content; if($mech->response->header("Content-Encoding") eq "gzip") { $dest = Compress::Zlib::memGunzip($dest); } $x = $mech->content(); open(Myfile,'>',"rt.txt"); print Myfile $x; if($dest =~ m/successfully/sig) { print "Message sent successfully \n" if($deb); } } print "Message sent to all the numbers\n Bye.\n"; exit;

In reply to Trying to send SMS from PC to Mobile but unable to select "Send Free SMS" button on the home page by ravi teja

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.