William:
 
By using the sample script you provided, I will no longer go back to login page after 
successfully log in once.  Thank you very much.  
 
I have another quick question for all of you.  I used to use Internet Junkbuster to 
log all the HTTP requests that went through the webbrowser, and this feature makes my 
life much easier to write down a Perl script.  Unfortunately, JunkBuster doesn't work 
under HTTPS, because all the HTTP requests are encrypted.  Is there a similar program 
which works under HTTPS and can log all HTTP requests?
 
Thank all of you for your help
 
Jack
 
 


"(William) Wenjie Wang" <[EMAIL PROTECTED]> wrote:
Hi Jack,

I've done something like following code snip and it works fine for me. Hope
it'll help:

---------------------------8<------------------------------------
my $myUserAgent = LWP::UserAgent->new(keep_active => 2);
$myUserAgent->agent("Mozilla/4.0 (compatible; MSIE 6.0; Win32)");
$myUserAgent->cookie_jar(HTTP::Cookies->new(autosave => 1));


# download login form
.....
# parse and fill out form data
my $LoginForm = HTML::Form->parse($myResponse->content,
$myResponse->base());
$LoginForm ->value('username' => $username);
$LoginForm ->value('password' => $password);
....
# submit form
$myResponse = $myUserAgent->request($myForm->click() );

# Get the page you want if login was sucess.
my $myResponse = $myUserAgent->request(HTTP::Request->new($Verb, $PageURL));

---------------------------8<------------------------------------


Regards,
WWang



---------------------------------
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

Reply via email to