package WWW::Mechanize::Plugin::Web::Scraper; use strict; use warnings; our $VERSION = '0.02'; use Web::Scraper; ##################################################################### sub import { } # This plugin does not have any import options sub init { no strict 'refs'; *{caller(). '::scrape'} = \&scrape; } sub scrape { my ($mech, @processes) = @_; my $scraper = scraper { process @processes }; return $scraper->scrape($mech->response); } 1; __END__ =head1 NAME WWW::Mechanize::Plugin::Web::Scraper - Scrape the planet! =head1 SYNOPSIS use strict; use WWW::Mechanize::Pluggable; my $mech = WWW::Mechanize::Pluggable->new(); $mech->get("http://search.cpan.org/"); $mech->submit_form( form_name => "f", fields => { query => "WWW::Mechanize" } ); my $results = $mech->scrape( "/html/body/h2/a", "results[]", { title => "TEXT", url => '@href' } ); =head1 DESCRIPTION C gives you the scraping power of L in L, hence the name ... =head2 METHODS =head3 scrape C is the only new method that can be called (as of yet) and accepts process information as described in L. Note that the function I can (and should) be omitted. The scraper will use the current L content, so make sure to "browse" to the right page before calling the scrape function. =head1 SEE ALSO =over 4 =item L =item L =item L =back =head1 BUGS C Most likely you want to pester either L (if L is broken), L (if L isn't working as expected) or L (the L mastermind). If these three people can't help, it then might be possible that this module is to blame (ok, I admit it, this module probably *is* to blame to begin with). Please be so kind to report it to L. =head1 AUTHOR Menno Blom, Eblom@cpan.orgE, L =head1 COPYRIGHT This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. =cut