Note that there are some explanatory texts on larger screens.

plurals
  1. POAutomating sms sending by through Way2sms in Perl
    primarykey
    data
    text
    <p>I am trying to send sms through Way2sms using Perl LWP. The login part is being successful, after which I save the cookies to a local file. The welcome page after being logged in shows a <strong>Send SMS</strong> link, clicking on which one is redirected to another page with two inputs for mobile number and sms text and a button for submitting and sending the sms. Firebug reveals the page structure as shown in the figure. From the Iframe url and the form's <code>action</code> attribute, I constructed the form action's absolute URL and submit the form accordingly, with the cookie stored in the file. However, the sms isn't sent. What I am doing wrong here? The code is as follows. (The <code>name</code> attributes for the two text inputs are correct, taken by observing the source code in Firebug, although that's not included in the image)</p> <pre><code>use LWP::UserAgent; open f, "&gt; way2sms.txt"; use HTTP::Cookies; my $cookie_jar = HTTP::Cookies-&gt;new( file =&gt; "cookies.txt", autosave =&gt; 1, ); my $ua = LWP::UserAgent-&gt;new( agent =&gt; 'Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1', cookie_jar =&gt; $cookie_jar, ); my $response = $ua-&gt;post( 'http://site2.way2sms.com/contentt/bar/Login1.action', { username =&gt; $user, password =&gt; $pass, } ); if ( $response-&gt;is_redirect ) { $response = $ua-&gt;get( $response-&gt;header('Location') ); print 5 if $response-&gt;decoded_content =~ /Kaustav Mukherjee/i; #prints it, showing that the login is successful } my $smsresp = $ua-&gt;post("http://site5.way2sms.com/jsp/quicksms.action",[MobNo=&gt;$mob,textArea=&gt;'Hello World']); </code></pre> <p><img src="https://i.stack.imgur.com/RBLiC.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload