Fw: Logging in to form based log in page

Thanks for the response.  I tried that to no avail.  Here is what the "new"
code looks like:
my $myUserAgent = LWP::UserAgent->new;
$myUserAgent->agent("Automation/0.1");
my $myRequest = HTTP::Request->new(POST => $configSettings{"url"});
$myRequest->content_type('application/x-www-form-urlencoded');
$myRequest->content("URI=/documents/database.htm&From=wsjauth&Login=xyz&Pass
word=123");
my $myResponse = $myUserAgent->request($myRequest);
Thanks,
Kenny
----- Original Message -----
From: "WORENKLEIN, David, GCM" <David.Worenklein@gcm.com>
To: "'Kenny G. Dubuisson, Jr.'" <kdubuisson@kcmria.com>
Sent: Tuesday, July 09, 2002 10:12 AM
Subject: RE: Logging in to form based log in page

> 1. I don't know if WSJ fields are case sensitive, but they call them
> "Login" and "Password"
> 2. You're not passing the hidden fields
> <input type=hidden name=URI value="/documents/databank.htm">
> <input type=hidden name=From value="wsjauth">
>
> -----Original Message-----
> From: Kenny G. Dubuisson, Jr. [mailto:kdubuisson@kcmria.com]
> Sent: Tuesday, July 09, 2002 10:59 AM
> To: libwww@perl.org
> Subject: Logging in to form based log in page
>
> Hello all.  I'm trying to write a script that logs in to a web page that
> has the user name and password input boxes as part of the initial web
page.
> I've tried doing a "POST" with the user name and password declarations and
> values in the request to no avail.  Here is my code:
>
> my $myUserAgent = LWP::UserAgent->new;
> $myUserAgent->agent("Automation/0.1");
> my $myRequest = HTTP::Request->new(POST =>
> "http://online.wsj.com/login?URI=%2Fdocuments%2Fdatabank.htm");
> $myRequest->content_type('application/x-www-form-urlencoded');
> $myRequest->content("login=xyz&password=123");
> my $myResponse = $myUserAgent->request($myRequest);
>
> Any ideas on what I'm doing wrong?  I've double-checked the form input
> field names and they are "login" and "password".  Any help you could offer
> would be much appreciated.  I've ordered the new PERL & LWP book but it
> hasn't gotten here yet so I thought I'd post this message.
>
> Thanks,
> Kenny Dubuisson, Jr.
> Gulfport, Mississippi, USA
>
>
> **********************************************************************
> This e-mail is intended only for the addressee named above.
> As this e-mail may contain confidential or privileged information,
> if you are not the named addressee, you are not authorised to
> retain, read, copy or disseminate this message or any part of it.
> ************************************************************************
>
0
kdubuisson
7/9/2002 3:22:00 PM
📁 perl.libwww
📃 3335 articles.
⭐ 0 followers.

💬 1 Replies
👁️‍🗨️ 696 Views


"Kenny G. Dubuisson, Jr." wrote:
> 
> Thanks for the response.  I tried that to no avail.  Here is what the "new"
> code looks like:
> 
> my $myUserAgent = LWP::UserAgent->new;
> $myUserAgent->agent("Automation/0.1");
> my $myRequest = HTTP::Request->new(POST => $configSettings{"url"});
> $myRequest->content_type('application/x-www-form-urlencoded');
> $myRequest->content("URI=/documents/database.htm&From=wsjauth&Login=xyz&Pass
> word=123");
> my $myResponse = $myUserAgent->request($myRequest);
you might need to:
- pass an "approved" useragent string (e.g. MSIE)
- pass a HTTP_REFERER header indicating you "came from" the WSJ login page
- etc.
0
doug
7/9/2002 3:28:24 PM
Reply: