Dear Monks,
I have been trying to log into a page and getting HTML response. I have used the following code:The problem is when I run this script, HTML page of Login is returned whereas I want to get HTML page of http://www.xyz.com/Protected/Track.aspx. How could I get this page?#!/usr/bin/perl use Time::localtime; use LWP::Simple; # Create a user agent object use LWP::UserAgent; $ua = LWP::UserAgent->new; $req = HTTP::Request->new(GET => 'http://www.xyz.com/Protected/Track.a +spx'); $ua->credentials( 'www.ats.ca:80', 'http://www.xyz.com/Login.aspx', 'user' => 'password' ); # send request $res = $ua->request($req); # check the outcome if ($res->is_success) { print "\n\n\n\n\nSuccessful\n\n\n\n\n"; print $res->content; } else { #print $res->content; print "Error: " . $res->status_line . "\n"; }
2005-03-24 Janitored by Arunbear - added code tags, as per Monastery guidelines
In reply to Log into a screen and getting a response by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |