snoofkin
snoofkin

Reputation: 8895

How to do I use a web proxy with Perl's WWW::Mechanize?

I'm trying to use WWW::Mechanize with a proxy server, but seems like I cant get it to work. Since Mechanize is a subclass of LWP::UserAgent, I've been reading about the proxy thing over link text

I have a list of proxies, for example:

74.87.151.157:8000  
69.171.152.25:3128  
190.253.82.253:8080 
189.11.196.221:3128 
41.234.205.201:8080

I have no idea how to use them.

Thanks,

Upvotes: 0

Views: 1351

Answers (1)

Eugene Yarmash
Eugene Yarmash

Reputation: 150215

This example sets a HTTP-proxy:

my $mech  = WWW::Mechanize->new();
my $proxy = '74.87.151.157:8000';

$mech->proxy('http', "http://$proxy");

Upvotes: 1

Related Questions