in reply to Problem in login in web page

This page is using JavaScript, but WWW::Mechanize can't handle JS.

> Please note that Mech does NOT support JavaScript, you need additional software for that. Please check "JavaScript" in WWW::Mechanize::FAQ for more.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^2: Problem in login in web page (JS)
by GHMON (Novice) on Sep 28, 2018 at 16:18 UTC

    tnx

Re^2: Problem in login in web page (JS)
by GHMON (Novice) on Sep 28, 2018 at 17:33 UTC

    Hi again what is your opinion about this code !!!!!

    use strict; use warnings; use strict; use WWW::Mechanize; use LWP ; use HTTP::Cookies; my $url = 'http://2010.tct.ir/CustomerSignIn.aspx'; my $username = 'X'; my $password = 'Y'; my $mech = WWW::Mechanize->new( agent=>"Mozilla/5.0 (X11; U; Linux i68 +6; en-US; rv:1.7) Gecko/20040918 Firefox/0.9.3 ") ; my $cookies = HTTP::Cookies->new(file => './lwp_cookies.dat' , autosav +e => 1 ,) ; $mech->cookie_jar($cookies) ; $mech->post($url) ; $mech->form_id('Form1') ; $mech->field('LoginControl$FileIDTextBox'=> $username) ; $mech->field('LoginControl$PasswordTextBox'=>$password) ; $mech->submit ('LoginControl$ButtonSignInn') ; print $mech->content() , "\n" ;