Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Has anybody managed to install Mozilla::Mechanize on Debian?

Also, anybody here using Mozilla::Mechanize or its sibling, Win32::IE::Mechanize? Can it handle onSubmit Javascript and follow link to javascript: links, which in turn opens some link in another frame? I'm trying to automate pulling balance inquiries from an Internet banking site, which utilizes a lot of Javascript and frames.

Replies are listed 'Best First'.
Re: Mozilla::Mechanize question
by ikegami (Patriarch) on Oct 10, 2007 at 05:57 UTC

    Win32::IE::Mechanize can definitely handle JS. Win32::IE::Mechanize simply runs IE as a OLE control, so it does everything just like IE would, including using and changing IE's cookies, cache and history. Think of the module as a remote control for IE.

    Mozilla::Mechanize is suppose to be the same thing for Mozilla. It should handle JS without problem. I have never used it.

      Althouh Win32::IE::Mechanize uses IE as a OLE control. I have faced problem of login to a website which was using heavy javasripts. This module can help you (I mean this is a best of available options) however it cannot be used as a general solution.
Re: Mozilla::Mechanize question
by Gangabass (Vicar) on Oct 10, 2007 at 03:56 UTC

    I'm think No :-(. It very hard to handle Javascript such as handlers and javascript: links.

    You can try install LiveHTTPHeaders for Firefox and record request which your browser do than you make some page activity (e.g. clicking a button). And after that you can repeat those requests in your script.

Re: Mozilla::Mechanize question
by mkirank (Chaplain) on Oct 10, 2007 at 22:23 UTC

      From the Selenium website: "Selenium Core uses a unique mechanism which allows it to run on so many platforms. Written in pure JavaScript/DHTML, you copy Selenium Core tests directly into your your application webserver, allowing the tests to run in any supported browser on the client-side. Thus, you must have write access to the machine your web application server is running on to install Selenium Core."

      Well, this means you can't use it to mechanize against remote/3rd party websites.

        You can use remote control and need not have to use selenium core..I have not used it using https but as per the tutorials it is possible