Andre_br has asked for the wisdom of the Perl Monks concerning the following question:

Hey everyone, I have a script that uses LWP to grabs the html page with the shipping cost of domestic deliveries here in Brasil, but suddenly it has stopped working. Is anyone having the same problem? Here´s my code:
my $url = "http://www.correios.com.br/encomendas/precos/calculo.cfm?re +sposta=paginaCorreios&servico=40045&MaoPropria=n&avisoRecebimento=N&c +epOrigem=$cep_origem&cepDestino=$cep_destino&peso=$peso&valorDeclarad +o=$valordeclarado"; my $response = $browser->get( $url ); die "Can´t get $url:" , $response->status_line unless $response->is_su +ccess; # o método get() do LWP::Simple my $html = $response->content; if ( $html =~ /\<b\>R\$\s(.*)\<\/b\>/ ) { # O string é, p.ex., "<b>R$ +12,40</b>". $frete_virgula = $1; }
Thanks a lot! André
  • Comment on Any brazilian monk having problem with the post office shipping calculation page?
  • Download Code