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();
source share