chew23 has asked for the wisdom of the Perl Monks concerning the following question:
without the proxy this seems to be working but if i try using the proxy server it doesn't work giving me back the following exit code:#!/usr/bin/perl use strict; use WWW::Mechanize; use HTTP::Cookies; use HTTP::Request; print " WWW::Mechanize $WWW::Mechanize::VERSION LWP $LWP::VERSION "; my $webpage = ''; my $outfile = "out.htm"; my $url = "https://xxxxx.it"; my $username = "xxxxxx"; my $password = "xxxxxx"; my $mech = WWW::Mechanize->new(); my $cookie_jar = HTTP::Cookies->new( autosave => 1, file => "cookies.t +xt"); $mech->env_proxy(); $mech->get($url); $mech->cookie_jar($cookie_jar); $mech->form_name('Login'); $mech->field(IDToken1 => $username); $mech->field(IDToken2 => $password); $mech->click(); #$mech->submit(); my $output_page = $mech->content(); open(OUTFILE, ">$outfile"); print OUTFILE "$output_page"; close(OUTFILE); print $cookie_jar->as_string, "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize trought a proxy for an https page
by almut (Canon) on Mar 25, 2010 at 16:19 UTC |