Solved

Getting web page from intranet using perl

Posted on 2011-09-30
2
799 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

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…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

770 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