use WWW::Mechanize::Link; #use WWW::Mechanize::Firefox; use strict; #use WWW::Scripter::Plugin::JavaScript; #use WWW::Mechanize; use WWW::Mechanize::Firefox; use HTTP::Cookies; use LWP::Debug qw(+); #$w = new WWW::Scripter; #$w->use_plugin('JavaScript'); my $outfile = "out.htm"; my $url = "https://minhaconta.levelupgames.com.br/login.aspx?ReturnUrl=%2f"; my $username = "lrodrigons"; my $password = "luc1an02"; my $mech = WWW::Mechanize::Firefox->new(); #$mech->cookie_jar(HTTP::Cookies->new()); my $cookie_jar = $mech->cookies(); $mech->get($url); $mech->form_name('form'); $mech->field('logLevelUpAccount$UserName' => $username); $mech->field('logLevelUpAccount$Password' => $password); #$mech->click(id => 'logLevelUpAccount$LoginImageButton'); $mech->click_button( id => 'logLevelUpAccount_LoginImageButton' ); #$mech->click(); #$mech->submit; #$mech->follow_link(text => "click here", n => 1); #$mech->follow_link(text => "Ragnarok", n => 1); #$mech->click( 'rptGames_ctl05_lnkDetailGame' ); $mech->click( {selector => '#rptGames_ctl05_lnkDetailGame, synchronize => 0'}); $mech->click( {selector => '#rptGames_ctl05_rptGameDetail_ctl01_btnUnlockAccount, synchronize => 0'}); my $output_page = $mech->content; open(OUTFILE, ">$outfile"); print OUTFILE "$output_page"; close(OUTFILE); #$mech->follow_link( url_regex => qr/rptGames.ctl05.rptGameDetail.ctl01.btnUnlockAccount/i ); #$mech->follow_link( n => 3 ); #$mech->click( text => 'Ragnarok' ); #$mech->click(name => 'rptGames$ctl05$rptGameDetail$ctl01$btnUnlockAccount');