in reply to How to get password protected content via LWP - by emulating my own browser (that can view that content)

"Want to make use of already authenticated session that I started on mozilla."

Is there a specific reason for this? If not, try the credentials() method?

use LWP::UserAgent qw(); my $ua = LWP::UserAgent->new; my $netloc = 'http://www.buddhism-dict.net/cgi-bin/xpr-dealt.pl:80'; $ua->credentials( $netloc, 'CJK-E and Buddhist Dictionaries', # basic realm 'guest', # user '', # empty pw ); my $response = $ua->get($netloc);

Example taken from Rosetta Code.

I'm so adjective, I verb nouns!

chomp; # nom nom nom

  • Comment on Re: How to get password protected content via LWP - by emulating my own browser (that can view that content)
  • Download Code

Replies are listed 'Best First'.
Re^2: How to get password protected content via LWP - by emulating my own browser (that can view that content)
by Prat824 (Acolyte) on Sep 03, 2008 at 23:31 UTC
    Thanks Lawliet No - there is no specific reason, but I tried authentication using LWP and failed so thought of using the mozilla cookiestore to utilized the already existing session. as regards your suggestion, do you know from where I could get the basic realm for my site? Thanks Prat

      I believe it is what appears in between the quotes when the popup box asks for the password when you try to navigate to the page in a browser.</baddirections>

      Something like Enter your username and password for 'realm'

      I'm so adjective, I verb nouns!

      chomp; # nom nom nom

        its not basic http authentication, its an html form with a submit button and lots of javascript