Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

issue with login to web site

by @loknath (Initiate)
on Nov 10, 2009 at 23:51 UTC ( [id://806374]=perlquestion: print w/replies, xml ) Need Help??

@loknath has asked for the wisdom of the Perl Monks concerning the following question:

Replies are listed 'Best First'.
Re: issue with login to web site
by snoopy (Curate) on Nov 11, 2009 at 02:57 UTC
    This could be a similar problem to this thread: Mechanize, Forms, Links, problem from Javascript?. I.e. JavaScript is dynamically populating or altering the form.

    If this is the case, you might consider a different tack. Instead of trying to fill in the form, doing the final form POST, using the post method.

    To take this approach, you'll need to work out the final structure of the form and what gets posted. Some browser tools might help with this analysis. For example Firefox's plugins include Web Developer (show the form data just before it's posted) and Live HTTP Headers (show the actual post).

Re: issue with login to web site
by Corion (Patriarch) on Nov 11, 2009 at 08:29 UTC

    WWW::Mechanize doesn't handle Javascript. So you'll either have to find out what the Javascript does, and replicate that in your Perl code. Or you have to instrument a browser, by using Win32::IE::Mechanize or WWW::Mechanize::FireFox.

    While I'm the author of WWW::Mechanize::FireFox, and it works very well for me, I'll note that the Mechanize API is very incomplete. But I use it to automate Javascript-heavy web applications.

Re: issue with login to web site
by markkawika (Monk) on Nov 11, 2009 at 01:15 UTC

    You might get more responses by asking a more concise question. I personally don't have time to read through all of that code.

      Hi, I was thinking the problem was in the source file. So that was the reason for putting the necessary code. Can you please help me out ? Thanks, Alok
Re: issue with login to web site
by desemondo (Hermit) on Nov 11, 2009 at 01:22 UTC
    But if you *really really* think you need all that code to explain your problem, please use some  <readmore> </readmore> tags...

    Eg.


    Also have a read of this too: Markup in the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://806374]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-10-03 17:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (42 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.