[SP-pm] Clicar em Avançar Mechanize
Daniel de Oliveira Mantovani
daniel.oliveira.mantovani at gmail.com
Fri Nov 28 07:56:48 PST 2008
Tenho o seguinte problema, vou dar um exemplo:
Nesse site :
http://www.magicdomain.com.br/index.php?sub=colecoes&idSerie=57
Se olhar em baixo irão se deparar com o "Avançar", eu quero que sempre que
encontre um avançar ele "click" e entre, e caso esse que ele entrou encontre
"Avançar" de novo ele entre e assim por diante.
Na verdade ele só precisa retornar os links. Estou tentando algo do tipo.
1 #!usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use WWW::Mechanize;
7
8 my $mech = WWW::Mechanize->new(timeout => 30);
9 $mech->get('
http://www.magicdomain.com.br/index.php?sub=colecoes&begin=1');
10 if ( $mech->success ) {
11 foreach my $busters ( $mech->find_all_links( url_regex =>
qr/idSerie|/ ) ) {
12 $mech->get( $busters->url_abs() );
13 while ( $mech->content=~ qr/Avançar/ ) {
14 $mech->follow_link( qr/Avançar/ );
15 print $mech->url_abs,"\n";
16 }
17 }
18 }
19 else {
20 print "Não pode pegar o site\n";
21 }
--
Procuro emprego C.V:
http://www.danielmantovani.site50.net/
print
"\x54\x68\x65\x20\x53\x69\x6c\x65\x6e\x74\x20\x47\x75\x61\x72\x64\x69\x61\x6e",$/
-------------- Pr?xima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/saopaulo-pm/attachments/20081128/60b89f41/attachment.html>
More information about the SaoPaulo-pm
mailing list