Hello, I'm a new franch user of perlmonks.org and I want to test the reactivity of users ! :D I have a problem with a login script. I want to connect the 178.33.132.12 and log to my user account with a webbot in perl But I don't understand with the method. There is my code :
#!/usr/bin/perl -w use strict; use LWP::UserAgent; use HTML::Form; use HTTP::Cookies; # initialisation de l'agent my $ua = LWP::UserAgent->new( agent => 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) +Gecko/20100101 Firefox/19.0', cookie_jar => HTTP::Cookies->new( file => 'LWPcookies.txt', autosave => 1, ignore_discard => 1, ) ); # initialisation de la requete my $base = 'http://178.33.132.12/'; my $res = $ua->request(HTTP::Request->new( GET => $base )); my $form = HTML::Form->parse($res->decoded_content, base => $res->base, charset => $res->content_charset, ); # afficher le Infolog my $infolog = $form->find_input('infolog')->value; print($infolog); # se logger my $user = 'LOGIN'; my $pass = 'PASSWORD'; my $loginlink = 'http://178.33.132.12/index.php?infolog=' . $infol +og . '&Login=' . $user . '&password=' . $pass . '&btn_login.x=66&btn_ +login.y=17'; $ua->request(HTTP::Request->new( GET => $loginlink ));
I'm sorry if I don't use convenience usage of perlmonks, I'm a beginner forum user. :s Please can you help me ?
In reply to Can you help a french user ? by ynnvlz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |