Using WWW :: Mechanize Credentials

I'm having trouble using the credential agent for WWW: Mechanize access and clean up the web that requires NTLM authentication. I read online that the credential agent requires 4 arguments: base, kingdom, username and password. I am not sure what to use for the database or area, so an example of them will be very useful. When I run my code, I get an error unauthorized in the line using $ url get. Any help would be appreciated

#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; use HTML::TokeParser; my $url= shift || "mywebsite.com"; my $agent = WWW::Mechanize->new( autocheck => 1 ); $agent->credentials ( "proxy:port", '', 'domain/username', 'password' ); $agent->proxy(['https', 'http', 'ftp'], 'proxy:port'); $agent->get( $url ); print $agent->content(); 
+4
source share
1 answer

This helps to read the documentation of the software you are working with. WWW :: Mechanize overrides the credentials method so that it also simply accepts a username and password. They are eventually passed to Authen :: NTLM.

+1
source

All Articles