1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#! /usr/bin/perl -w
use strict;
use LWP::UserAgent;
use HTML::Form;
my ($user , $pass) = qw (tel pass);
my $http = 'http://subscribe.free.fr/';
my $ua = LWP::UserAgent->new(
agent => 'Mozilla/5.0');
my $req = HTTP::Request->new (GET => "${http}login/login.pl");
my $res = $ua -> request($req);
die $res->status_line if not $res->is_success;
my $form = (HTML::Form->parse ($res->content , $http) )[1];
$form->find_input('login')->value($user);
$form->find_input('pass')-> value($pass);
my $rep = $ua->request ($form->click) ;
if ($rep->is_success){
print "succes";
}else{
print "non success";
} |
Partager