De uqe otra forma se puede hacer o alguien sabe de otro sitio? Gracias.
Código
use strict; use LWP::UserAgent; my $source = 'http://www.hidemyass.com/proxy-list/'; my $agent = 'Mozilla/5.0 (X11; Linux i686) Firefox/16.0'; my $browser = LWP::UserAgent->new( agent => $agent ); my $response = $browser->get($source); my $content = $response->content; " | CTIME | ANON LVL\n", '~' x 78, "\n"; while ( $content =~ m/(<tr class=".*?<\/tr>)/gs ) { my $tr = $1; my %data; while ( $tr =~ m/(<td[^>]*>.*?<\/td>)/gs ) { my $td = $1; if ( $td =~ m/updatets\s*">\s*(\d+ (:?secs|minutes?))</ ) { $data{'update'} = $1; } elsif ( $td =~ m/<style>/ ) { $data{'ip'} = de_css($td); } elsif ( $td =~ m/<td>\s*(\d+)\s*<\/td>/ ) { $data{'port'} = $1; } elsif ( $td =~ m/class="country".*?>\s*([^<]+)<\s/s ) { $data{'country'} = $1; } elsif ( $td =~ m/response_time.*?"width:(\d+%)"/s ) { $data{'rtime'} = $1; } elsif ( $td =~ m/connection_time.*?"width:(\d+%)"/s ) { $data{'ctime'} = $1; } elsif ( $td =~ m/<td>(https?|socks4\/5)<\/td>/i ) { $data{'type'} = $1; } elsif ( $td =~ m/rightborder">([^<]+)<\/td>/ ) { $data{'anon'} = $1; } } $data{'type'}, $data{'anon'}; } sub de_css { $ip =~ s/<(:?div|span) style="display:none">[^<]*<\/[^>]+>//g; $ip =~ s/\.[\w\-_]+\{display:inline\}//g; while ( $ip =~ m/\.([\w\-_]+)\{display:none\}/g ) { my $class = $1; $ip =~ s/\.$class\{display:none\}//; $ip =~ s/<span class="$class">[^<]*<\/span>//g; } $ip =~ s/\s*//gs; } __END__