Unfortunately, I can't quite get it to work. Do you by any chance know, where I could find more information about the links() method? CPAN does not list the find_links method.
Here is the code, I unsuccesfully tried, in case you are interested.
#!/usr/bin/perl -w use strict; use WWW::Mechanize; our $count=1; our $year=1976; while ($year<1977) { my $input; my $agent = WWW::Mechanize->new(); $agent->get("http://europa.eu.int/prelex/rech_avancee.cfm?CL=en"); $agent->form(2); $agent->field("clef2", "$year"); $agent->field("clef1", 'COM'); $agent->field("nbr_element", '99'); $agent->click(); $input=$agent->content(); my @pcplinks = grep { $_->url =~ m!liste_resultats.cfm! } $agent->link +s; print @pcplinks; my $filecount; $filecount=0; foreach my $pcplink (@pcplinks) { my $input2; print "Retrieving $pcplink\n"; $agent->follow( $pcplink ); $filecount++; $input2=$agent->content(); $agent->back; } }
In reply to Re^2: WWW::Mechanize and Navigation
by New Novice
in thread WWW::Mechanize and Navigation
by New Novice
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |