The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Web::Query - Yet another scraping library like jQuery

SYNOPSIS

use Web::Query;

wq('http://google.com/search?q=foobar')
      ->find('h2')
      ->each(sub {
            my $i = shift;
            printf("%d) %s\n", $i+1, $_->text
      });

DESCRIPTION

Web::Query is a yet another scraping framework, have a jQuery like interface.

Yes, I know Ingy's pQuery. But it's just a alpha quality. It doesn't works. Web::Query built at top of the CPAN modules, HTML::TreeBuilder::XPath, LWP::UserAgent, and HTML::Selector::XPath.

So, this module uses HTML::Selector::XPath and only supports the CSS 3 selector supported by that module. Web::Query doesn't support jQuery's extended queries(yet?).

THIS LIBRARY IS UNDER DEVELOPMENT. ANY API MAY CHANGE WITHOUT NOTICE.

FUNCTIONS

METHODS

HOW DO I CUSTOMIZE USER AGENT?

You can specify your own instance of LWP::UserAgent.

$Web::Query::UserAgent = LWP::UserAgent->new( agent => 'Mozilla/5.0' );

INCOMPATIBLE CHANGES

  1. 10

    new_from_url() is no longer throws exception on bad response from HTTP server.

AUTHOR

Tokuhiro Matsuno

SEE ALSO

pQuery

LICENSE

Copyright (C) Tokuhiro Matsuno

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.