?
Solved

Perl - WWW::Mechanize with a proxy server

Posted on 2003-11-18
1
Medium Priority
?
1,186 Views
Last Modified: 2012-06-27
Help!

I am using Perl WWW::Mechanize to access some websites.  The goal is to access certain pages on a corporate network and scrape information.  

I am running into a problem in that I can't get past the proxy server.  I have setup the following

my $agent = WWW::Mechanize->new();
$agent->proxy(http => "http://xxx.proxy.xxx.com:8001/");

but when I run

my $response = $agent -> get('http://www.tmng.com/HomePage/homepage.htm/');

I get a 403 error.

Now from IE, to setup the browser to run on the network, under Tools/Internet Options, undr the connection tab, in the LAN settings, you have to click on the Use Auto Configuration script option and the location is "http://xxx.proxy.xxx.com:8001".

How do I get Perl to recognize the auto config setting on the proxy server?  

Thanks
0
Comment
Question by:mattstarbuck
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 20

Accepted Solution

by:
jmcg earned 1600 total points
ID: 9774717
The URL

http://xxx.proxy.xxx.com:8001/

may refer only to the server holding the autoconfiguration file and not itself be a proxy server. You may need to retrieve that URL and examine its content (it will look a lot like JavaScript) to determine what to set as your proxy values. I'm not aware of a way to have an LWP script do this for itself.
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question