shanu_040 has asked for the wisdom of the Perl Monks concerning the following question:
Would really appreciate it if some one could guide me. Thanks Amitsub handler { my $r = shift; my $req = Apache2::Request->new($r); my $mech = WWW::Mechanize->new( agent => 'Mozilla/5.0', autocheck => 1, ); $mech->cookie_jar(HTTP::Cookies->new); my $domain = 'http://somesite.org'; my $uri = $req->param('uri'); if(defined $uri){ $mech->get($domain); }else{ my $args = $r->unparsed_uri(); my $base = "$domain$args"; $mech->get($base); } my $response = $mech->response(); my $html = $response->content; $r->content_type($mech->content_type); $r->content_encoding($response->content_encoding); print $html; return Apache2::Const::OK; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize and Cookies generated through Javascript
by jethro (Monsignor) on Aug 03, 2010 at 11:03 UTC | |
by shanu_040 (Sexton) on Aug 04, 2010 at 04:42 UTC | |
by jethro (Monsignor) on Aug 04, 2010 at 11:40 UTC | |
by shanu_040 (Sexton) on Aug 04, 2010 at 12:09 UTC | |
by jethro (Monsignor) on Aug 04, 2010 at 15:45 UTC | |
by shanu_040 (Sexton) on Aug 04, 2010 at 12:59 UTC | |
|
Re: WWW::Mechanize and Cookies generated through Javascript
by rowdog (Curate) on Aug 03, 2010 at 11:56 UTC |