use strict; use WWW::Mechanize::Firefox; my url= "**************************************"; my $mech = WWW::Mechanize::Firefox->new(timeout => 2 ); $mech->allow( javascript =>1); $mech->get($url); sleep(3); $mech->click({ xpath => '//span[@class="paginate_button"]' }, { xpath => '//*[contains(text(),"2")]' }); #print "First click ok" ; sleep(3); $mech->click({ xpath => '//span[@class="paginate_button"]' }, { xpath => '//*[contains(text(),"3")]' }); sleep(3);