Solved

Getting web page from intranet using perl

Posted on 2011-09-30
2
789 Views
Last Modified: 2012-05-12

I am attempting to download an intranet page using lwp::userAgent. I have tried a number of different approaches including using Authen-NTLM-HTTP but I appear to be unable to get authorization or I get page not found.
I am able to access pages through R using --internet2.dll which uses existing internet explorer settings.
Error messages:

Server: Microsoft-IIS/6.0
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
Content-Length: 1656
Content-Type: text/html
Content-Type: text/html; charset=Windows-1252
Client-Date: Fri, 30 Sep 2011 13:33:52 GMT
Client-Peer: 166.14.6.18:80
Client-Response-Num: 2
Client-Warning: Unsupported authentication scheme 'ntlm'
Proxy-Connection: Keep-Alive
Proxy-Support: Session-based-authentication
Title: You are not authorized to view this page
X-Powered-By: ASP.NET


Code Summary:



use LWP::UserAgent;
use HTTP::Request::Common;
$ua = new LWP::UserAgent(keep_alive=>1);
$ua -> proxy ('http', 'myproxy')
$ua->agent("Mozilla/6.0");
$ua->credentials(a,b,c,d);
$req = GET 'http://url";
0
Comment
Question by:benwilkinson
2 Comments
 
LVL 9

Accepted Solution

by:
Suhas . earned 500 total points
ID: 36892168
Try the module Win32::IEAutomation , if you can use Internet Explorer
0
 
LVL 23

Expert Comment

by:nemws1
ID: 36892608
There is a discussion, along with a solution and code examples using LWP::Authen::Ntlm here:

  http://www.linuxquestions.org/questions/programming-9/perl-with-lwp-and-ntlm-621296/
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now