in reply to Re^5: Automate WebLogin
in thread Automate WebLogin

Well i read the documentation for WWW::Mechanize::Firefox and WWW::Scripter::Plugin::JavaScript.Out of the two I got more interested in WWW::Scripter::Plugin::JavaScript.I believe WWW::Scripter::Plugin::JavaScript uses JE as the backend engine.Please do correct me if you feel otherwise.I m sorry I never wanted to heed anyone's advice.I started with parsing the javascript response I got and embedded login credentials but got stuck with the "click".Read what Corion suggested but wasn't able to understand much.

Replies are listed 'Best First'.
Re^7: Automate WebLogin
by Corion (Patriarch) on Jan 26, 2011 at 15:34 UTC

    I'm not sure what part of my advice you have problems with. I try to make the steps clear, so please tell me what step I didn't explain thoroughly enough:

    Learn what your browser sends, then send that from Perl.

    This is meant to tell you to investigate what data your browser sends to the remote webserver when you click a button. The intention behind is that the remote webserver cannot know whether there is a browser or a Perl script at the other side, so as long as your Perl script sends the same data as a browser, it will never find out.

    For example, using the Live HTTP Headers extension.

    This sentence is to show you a tool that can do the above.

    Or learn Javascript and how it interacts with the HTML DOM, and what the click for a submit button does.

    This sentence is intended to show you the other, more static, approach to scraping. Read (and understand) the Javascript and what it does, and directly replicate that from Perl.

    Or just modify the code to find it out.

    This sentence is to show you a variation on the more static approach. By modifying the Javascript code, you can also maybe find out what it does and what purpose it has.

      Hi Corion - Sorry for the confusion but I was not able to understand the Live HTTP Headers articles.Probably because of the kind of experience I have.I didn't give the second one a try(learning Javascript).Tried the last one and modified the Javascript response i got but got stuck with the click.I would like to follow more on this

        The Live HTTP Headers are a plug-in for Firefox, a web browser in common usage. They allow you to see what your browser sends, so that you can replicate that from Perl.

        If you are automating websites using Javascript, some amount of Javascript knowledge is inevitable. I recommend you try to at least vaguely understand the Javscript that the pages use.

        None of the solutions can shield you from understanding what goes on between the web browser and the webserver, so I recommend you start familiarizing yourself with that.

        I find Firebug helpful when debugging JavaScript, it's not a substitute for learning JavaScript but it can help pinpoint problems.

Re^7: Automate WebLogin
by marto (Cardinal) on Jan 26, 2011 at 15:35 UTC