NAME

WWW::ContentRetrieval::Spider - Simplified WWW User Agent

SYNOPSIS

use WWW::ContentRetrieval::Spider;
$s = new WWW::ContentRetrieval::Spider(
  URL         => 'http://foo.bar/',
  METHOD      => 'PLAIN',
  PARAM       => { 'paramA', 'valueA' },
  QUERY       => [ querykey, queryvalue ],
  HTTP_PROXY  => 'http://foo.bar:2345/',
  TIMEOUT     => 10,
);

print $s->content;

DESCRIPTION

WWW::ContentRetrieval::Spider is a simplified www useragnet for web page retrieval, and is designed mainly for WWW::ContentRetrieval. Many features of LWP are excluded from here.

METHODS

new

$s = WWW::ContentRetrieval::Spider->new(
  URL         => 'http://foo.bar/',
  METHOD      => 'PLAIN',                     # default is 'GET'
  QUERY       => [ querykey, queryvalue ],    # user's query
  PARAM       => { 'paramA' => 'valueA' }     # other parameters
  TIMEOUT     => 5,                           # 10 if undef
  USERAGENT   => 'WWW::ContentRetrieval::Spider'      # becomes Mozilla if undef
  HTTP_PROXY  => 'http://foo.bar:2345/',
);

And, it is better not to mix URL and its parameters together.

content

$s->content() returns url's content if success. Or it returns undef

content_to_file

$s->content_to_file(FILENAME) dumps content to a file

EXPORT

queryURL(
    URL         => $url,
    METHOD      => 'POST',
    PARAM       => { 'paramA', 'valueA' },
    QUERY       => [ querykey, queryvalue],
);

returns a GET-like URL for debugging or other uses, even though request method is POST.

SEE ALSO

WWW::ContentRetrieval, WWW::ContentRetrieval::Extract, LWP

COPYRIGHT

xern <xern@cpan.org>

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