in reply to Re^3: Can't make WWW::Mechanize work through proxy programmatically
in thread Can't make WWW::Mechanize work through proxy programmatically

Yes, i've checked, the LWP version works over proxy, but mechanize version doesn't with the same proxy config, using the same ->proxy method with the same options, that work in LWP.
So, how can I use that knowledge. I still need to use mechanize. Is there a way to use mechanize over LWP? or download with LWP, and process with mechanize?
  • Comment on Re^4: Can't make WWW::Mechanize work through proxy programmatically

Replies are listed 'Best First'.
Re^5: Can't make WWW::Mechanize work through proxy programmatically
by Anonymous Monk on Oct 22, 2022 at 23:51 UTC

    Like I said, unlikely story

    #!/usr/bin/perl -- use strict; use warnings; use LWP; use WWW::Mechanize; for my $class ( qw/ LWP::UserAgent WWW::Mechanize /){ my $ua = $class->new; warn "$ua\n"; $ua->show_progress( 1 ); $ua->proxy( [ qw{ http https } ] => q{http://127.6.6.6} ); $ua->get( q{http://example.com} ); } __END__ LWP::UserAgent=HASH(0x99b58c) ** GET http://example.com ==> 500 Can't connect to 127.6.6.6:80 (No co +nnection could be made because the target machine actively refused it +.) (1s) WWW::Mechanize=HASH(0xeb8714) ** GET http://example.com ==> 500 Can't connect to 127.6.6.6:80 (No co +nnection could be made because the target machine actively refused it +.) (1s) Error GETing http://example.com: Can't connect to 127.6.6.6:80 (No con +nection could be made because the target machine actively refused it. +) at lwp-mech-proxy.pl line 14.

    Thats both LWP and Mechanize accepting the proxy setting and trying to connect