471,831 Members | 1,029 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,831 software developers and data experts.

LWP::UserAgent Get a page after authenicating in SSL mode

Hi All,
I am using LWP::UserAgent and HTML::TreeBuilder to communicate to the below site
Here is the website map:

https://secure.server.com/index.htm which asks for two fields
then submit button
the form is submitted to
which validates the login credentials and if validated then user is redirected to main.asp and there will be a link called
which will have field
and after typing the serialnumber and hitting submit button the data is POST'ed to data.asp and details like
1) Manufacured_date
2) Model
3) Site .e.t.c comes in a tabular format.

Now the requirement:
I have to write a perl script which will do all these jobs behind the screen using LWP::UserAgent and use HTML::TreeBuilder. Since the site is SSL based i used CRYPT:SSLeay. Now my program looks like this

Expand|Select|Wrap|Line Numbers
  1. use strict;
  2. use warnings;
  3. use LWP::UserAgent;
  4. use HTML::TreeBuilder;
  6. my $ua = LWP::UserAgent->new( agent => 'Mozilla/5.0' );
  8. my $response1 = $ua->post('https://secure.server.com/login.asp ', [
  9.     "user_id"  => "anonymous",
  10.     "user_pwd" => "password",
  11. ]);
  13. my $response = $ua->post( 'https://secure.server.com/data.asp', [
  14.     "tx_Sno" => "T450W34990",
  15. ]);
  16.     print $response->status_line;
  17.     print $response1->status_line;
  18.     print $response->content;
  19.     print $response1->content;
The output is Status ok but the login data.asp is not getting into the session and it returns the response..
which means the session created by response1 is not applying to response POST. Can anyone help me how to handle this situation...
Aug 29 '07 #1
3 2044
4,059 Expert 2GB
hmmm... that makes at least three forums now you have this posted on. I can see posting on a forum and after not getting any replies after a day or two moving on, but this is not the case.
Aug 29 '07 #2
1,089 Expert 1GB
Yes. Uninterested in cross forum posts.

- Miller
Aug 29 '07 #3
4,059 Expert 2GB
Make it 4 forums.....
Aug 30 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Woogie | last post: by
reply views Thread by Chandra | last post: by
1 post views Thread by Hal Vaughan | last post: by
reply views Thread by Playker | last post: by
2 posts views Thread by haimk63 | last post: by
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.