Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Can't make WWW::Mechanize work through proxy programmatically

by Anonymous Monk
on Sep 25, 2022 at 11:35 UTC ( [id://11147121]=note: print w/replies, xml ) Need Help??


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

Proxy setting is set/accepted. Lwp/mech tries to connect to proxy (it works) but can't connect because there is no proxy. Proxy is not bypassed. You say this fails.

Replies are listed 'Best First'.
Re^4: Can't make WWW::Mechanize work through proxy programmatically
by igoryonya (Pilgrim) on Sep 25, 2022 at 23:57 UTC
    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?

      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11147121]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-03-28 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found