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
Solved

Getting web page from intranet using perl

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
crawling gofundme 4 132
Regular Expression question to filter with negation. 6 100
PERL - Find newest folder 12 151
Perl Frameworks 1 98
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…

828 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