How to use script get login page? 
Author Message
 How to use script get login page?

Hi,

I have a script want to get a page, first get the login page, then fill
the from and send back, but what I got is the same login page. I don't
know what's wrong. Thanks for any help in advance!
my script is:

#!/usr/bin/perl

use LWP::UserAgent;
require LWP::UserAgent;
use HTML::Form;

my $ua = LWP::UserAgent->new(env_proxy => 1,
                             keep_alive => 1,
                             timeout => 30,
                             requests_redirectable=>['GET','POST','HEAD']
                             );
$ua->cookie_jar({ file => "$ENV{HOME}/.cookies.txt" });

$response = $ua->get(' http://www.*-*-*.com/ ');
$form = HTML::Form->parse($response->content,$response->base());
$form->value(User => "user", Password =>"mypassword");
$response = $ua->request($form->click("submit"));
print $response->content;



Sat, 09 Apr 2005 05:23:11 GMT  
 How to use script get login page?

Quote:

> Hi,

> I have a script want to get a page, first get the login page, then fill
> the from and send back, but what I got is the same login page. I don't
> know what's wrong.

you have to pretend to be a web browser, including cookie and redirection
support.  in some cases you have to execute javascript.

figure out everything that is happening between the web server and a
consumer-grade browser, then program that. :)

--

The Perl Review - a new magazine devoted to Perl
<http://www.theperlreview.com>



Sat, 09 Apr 2005 08:28:11 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HTTP::Request help (Getting past ASP Login pages)

2. HTTP::Request help (Getting past ASP Login pages)

3. HELP with accessing HTML page to automate Login using HTML::Form

4. How to use script get login page?

5. Need Perl Script for Members Login Page- help

6. getting HTML pages with javascripts inside using perl?

7. Getting a web page content using perl

8. getting HTML pages with javascripts inside using perl?

9. Using PERL for NT Login Script

10. Getting Perl CGI Script To Get Me Back To Main Html Page

11. Looking for a login page?

12. user login and dynamic web pages

 

 
Powered by phpBB® Forum Software