package WWW::Scraper::ISBN::AmazonFR_Driver; use strict; use warnings; use vars qw($VERSION); $VERSION = '0.02'; #-------------------------------------------------------------------------- =head1 NAME WWW::Scraper::ISBN::AmazonFR_Driver - Search driver for the (FR) Amazon online catalog. =head1 SYNOPSIS See parent class documentation (L) =head1 DESCRIPTION Searches for book information from the (FR) Amazon online catalog. This module is a mere paste and translation of L. The main (only?) difference is in the parsing of the result. Here it is done with simple regexp, whereas in L it was done using L. =cut #-------------------------------------------------------------------------- ########################################################################### #Inheritence # ########################################################################### use base qw(WWW::Scraper::ISBN::Driver); ########################################################################### #Library Modules # ########################################################################### use WWW::Mechanize; ########################################################################### #Constants # ########################################################################### use constant AMAZON => 'http://www.amazon.fr/'; use constant SEARCH => 'http://www.amazon.fr/'; #-------------------------------------------------------------------------- ########################################################################### #Interface Functions # ########################################################################### =head1 METHODS =over 4 =item C Creates a query string, then passes the appropriate form fields to the Amazon (FR) server. The returned page should be the correct catalog page for that ISBN. If not the function returns zero and allows the next driver in the chain to have a go. If a valid page is returned, the following fields are returned via the book hash: isbn author title book_link thumb_link image_link pubdate publisher The book_link, thumb_link and image_link refer back to the Amazon (FR) website. =cut sub search { my $self = shift; my $isbn = shift; $self->found(0); $self->book(undef); my $mechanize = WWW::Mechanize->new(); $mechanize->get( SEARCH ); return $self->handler('Error loading amazon.fr form web page (unreachable?)') unless($mechanize->success()); my ($index,$input) = (0,0); $mechanize->form_name('site-search') or return $self->handler('Error parsing amazon.fr form'); my $keyword; # This is to search for books # (