I am trying to send sms via Way2sms using Perl LWP. The login part is successful, after which I save the cookies in a local file. The welcome page after entering the system shows the Send SMS link, clicking on which redirects to another page with two inputs for the mobile phone and SMS and a button for sending and sending SMS. Firebug shows the structure of the page as shown. From the iframe URL and the action attribute, I created an absolute form URL and submit the form accordingly, with the cookie stored in the file. However, SMS is not sent. What am I doing wrong here? The code is as follows. (The name attributes for the two text inputs are correct, taken by observing the source code in Firebug, although this is not included in the image)
use LWP::UserAgent; open f, "> way2sms.txt"; use HTTP::Cookies; my $cookie_jar = HTTP::Cookies->new( file => "cookies.txt", autosave => 1, ); my $ua = LWP::UserAgent->new( agent => 'Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1', cookie_jar => $cookie_jar, ); my $response = $ua->post( 'http://site2.way2sms.com/contentt/bar/Login1.action', { username => $user, password => $pass, } ); if ( $response->is_redirect ) { $response = $ua->get( $response->header('Location') ); print 5 if $response->decoded_content =~ /Kaustav Mukherjee/i;

source share