Kenny,

    In the past I've put together some perl code that extends
LWP::UserAgent.  I override or add a few methods using
HTTP::Request::Form, HTTP::Cookies, and HTML::TreeBuilder.  The end
result is that you can come up with an enhanced useragent that lets you
fill out forms, handle cookies, and parse HTML output.  I recommend
looking into the modules I mentioned if you haven't already.  I noticed
that in my code using my extended user agent, I also used
HTTP::Request::Common and URI::URL.  All my Javascript parsing was done
by looking at the javascript code and simulating it, though (usually it
was just putting together a URL in a straightforward fashion).

Bob

On Tue, Jun 10, 2003 at 04:52:50PM -0400, Kenneth E. Lussier <[EMAIL PROTECTED]> wrote:
> On Tue, 2003-06-10 at 16:31, [EMAIL PROTECTED] wrote:
> > 
> > In a message dated: Tue, 10 Jun 2003 16:24:43 EDT
> > Morbus Iff said:
> > 
> > > >Since we seem to have an abundance of Perl experts today, I have a
> > > >perplexing problem... I am trying to write a script that logs into a
> > > >website. The problem that I am running into is that the website requires
> > > >javascript. If the site detects that the "browser" doesn't support
> > > >javascript, then it loads the login form as an "unmodifiable form text
> > > >field" (as reported by lynx). Does anyone know a way around this?
> > >
> > >If the login is authenticated with javascript (?!!), then you're screwed. 
> > >What web site is it? Your best bet is to find out what the javascript is 
> > >exactly doing.
> > 
> > Which shouldn't be too hard, since you should be able to View->Source
> > and see the java script lines to determine what's going on.
> 
> I was just looking at the source, and it looks like I have another
> problem. The site *ALSO* requires cookies to be enabled (which I can get
> around using HTTP::Cookies, I think). The login code on the site doesn't
> use javascript, except for the button:
> 
> <td valign="top">
> <img src="/images/login_bar.gif" border=0>
> <FORM name=loginForm id=loginForm
> action="/scripts/loginmanager.dll?login" method=post onSubmit="return
> prepare(this)"
> target=_top>
> <INPUT TYPE=hidden NAME="MfcISAPICommand" VALUE="Login">
> <INPUT TYPE=hidden NAME="hashed" VALUE="0">
> <INPUT TYPE=hidden NAME=challenge
> value="647c2fc1fd44c1dbed0f58315e9dd1935876f5ec">
> <TABLE id=loginTable cellSpacing=1 cellPadding=1 width=150 border=0
> style="WIDTH: 150px">
> <TR>
> <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=1>User
> Name<br> </font>
> <INPUT id=a name=a disabled></TD></tr>
> <tr>
> <TD><FONT face="Verdana, Arial, Helvetica, sans-serif"
> size=1>Password<br></font>
> <INPUT id=b type=password name=b disabled LANGUAGE=javascript
> onKeyPress="return b_onkeypress()"></TD></TR>
> <tr>
> 
> 
> I looked at CPAN, and I installed JavaScript-0.52. But, in all honesty,
> I read through the documentaion on CPAN, and I think I'm more lost now
> than I was 20 minutes ago!!
> 
> C-Ya,
> Kenny

-- 
Bob Bell <[EMAIL PROTECTED]>
-------------------------------------------------------------------------
 "Shipping software is an unnatural act"
   -- David Stafford
_______________________________________________
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss

Reply via email to