0

I am trying to download pdf files present in a website using perl MECHANIZE module. It worked fine when i am running the program without any proxy connection. But i am getting the below error when i tried to run the program on the company server which uses proxy connection.

error:

Error GETing http://www.google.com: Can't connect to www.google.com:80 (10060) a t Download.pl line 20.

I am not sure if i need to add any proxy details in the program or Is this something that our company firewall is blocking programatical requests to a website ? I have tried a lot but coudn't find out. Can any one of you please suggest?

Fla-Hyd
  • 279
  • 7
  • 17

2 Answers2

2

If you using some kind of LWP related module you could set the following shell variables

HTTP_PROXY=your.corp.proxy:your_proxy_port

You could check the connection with telnet or with wget

telnet www.google.com 80

with wget

wget http://www.google.com

user1126070
  • 5,059
  • 1
  • 16
  • 15
  • thanks for your reply. I am working on windows 7. I have installed telnet client in windows to check the connection. I am not able to connect and the error message is as below "Connecting To www.google.com...Could not open connection to the host, on port 80 : Connect failed" – Fla-Hyd Jul 10 '13 at 16:21
0

You need to specify you proxy to the $mech:

 $mech->proxy(['http'], 'http://proxy_address:proxy_port/');
gangabass
  • 10,607
  • 2
  • 23
  • 35