Leser: 22
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use WWW::Mechanize; my $url = 'http://areaclienti.tre.it/selfcare/areaclienti133/4554_profilo_ITA_HTML.xsl'; my $mech = WWW::Mechanize->new(); $mech->get( $url ); $mech->submit_form( form_name => 'formDati', fields => { username => 'username', password => 'password', } ); my $page = $mech->follow_link( text_regex => qr/info costi/i ); print Dumper $page;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use WWW::Mechanize; my $url = 'http://areaclienti.tre.it/selfcare/areaclienti133/4554_profilo_ITA_HTML.xsl'; my $mech = WWW::Mechanize->new(); $mech->get( $url ); $mech->submit_form( form_name => 'formDati', fields => { username => 'username', password => 'password', } ); $mech->follow_link( text_regex => qr/info costi/i ); my $page = $mech->follow_link( text_regex => qr/visualizza soglie/i ); print Dumper $page;
print $page -> content;
2009-09-16T17:46:50 pktmIn diesem Zusammenhang ist es manchmal auch nützlich den Statuscode zu prüfen. content() ist nämlich leer, wenn umgeleitet wurde.