PrePAN

Sign in to PrePAN

POE::Component::Client::WWW::Mechanize Provides nonblocking use of WWW::Mechanize

Author
torbjorn@github
Date
URL
Status
In Review
Good

Synopsis

package MyModuleThatProvidesNonBlockingGET;

use strict;
use warnings;

use POE::Component::Client::WWW::Mechanize;

sub get_a_page {

  my $url = shift;

  POE::Component::WWW::Mechanize->spawn(@_) # args passed to POE::Component::HTTP::Client->spawn()

  $_[KERNEL]->post( "some_alias", "request", $url, "response" ); # "some_alias" given in ->spawn(...) above

}

1;

Description

Usage is near identical to POE::Component::Client::HTTP only WWW::Mechanize is used internally to massage the request before submit, and is fed the response back to keep track of cookies etc. as if W::M had sent the request itself.

Uses WWW::Mechanized and PoCo::Client::HTTP internally.

Comments

Here is the missing link to the code: https://github.com/torbjorn/poe-component-client-www-mechanize

Please sign up to post a review.