473,388 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 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 2167
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

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

Similar topics

by: La Jesus | last post by:
Hello - I am new to Perl, so sorry if this is a silly / ultra easy question. I am using LWP::UserAgent to POST a HTTP message to another website, and it works great. However, I can't figure...
by: Woogie | last post by:
When running the sample code below without a proxy the GET returns the expected data. When run with the $proxy uncommented the GET returns the content of the login page for the site being...
by: Chandra | last post by:
Hello gurus, I am using LWP::Useragent perl module to get a url from the www. Code snippet: #!perl -w use LWP::UserAgent; LWP::Debug::level('+'); $ua = new LWP::UserAgent || die "$!";
by: Hal Vaughan | last post by:
I'm trying to access a site with data that needs to be paged through, one page at a time. It won't allow back buttons and you have to use the menu links to get through. In other words, it is run...
by: Vinay Gupta | last post by:
Hi, In a Perl to Tcl conversion project, I am planning to use the following Tcl extensions as a replacement for some Perl libraries. My development environment is Windows. Win32::OLE --> "DDE"...
by: Playker | last post by:
Hello I have a website on 2 servers. I want to make a script which checks is first server availbale (he often breaks down) and redirects to 1st or 2nd server. Script works well if an error is the...
by: haimk63 | last post by:
Hi ! I am beginner in PERL. I would like to know whether the LWP::UserAgent module? can be used in any server that supports PERL. Thanks
by: kkamath | last post by:
Hi, I use LWP::UserAgent to automate windows login process. I set the credentials using $ua->credentials("host:port","realm","id","password"); but it fetches only the current page requested. It...
by: cketcham | last post by:
All, I have the following code: use 5.010; use LWP::UserAgent; use URI::URL; use LWP::Debug qw(+); my $browser = LWP::UserAgent->new();
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.