 |
Get The Link
# The Search Results page
my $template = <<END;
<!-- BOOK COLLECTION -->[% ... %]<a href="[% book %]" target="_self">[% ... %]
END
my $extract = Template::Extract->new;
my $data = $extract->extract($template, $mechanize->content());
unless(defined $data) {
print "Error extracting data from ORA result page.\n" if $self->verbosity;
$self->error("Could not extract data from ORA result page.\n");
$self->found(0);
return 0;
}
my $book = $data->{book};
|
- simple template, which extracts the book link
- use Template::Extact to do the work for us.
- report problems if we couldn't grab the book link
- If okay, store the book link
|