in reply to Re^4: Is it possible to trigger a mouse click action in a browser using Perl?
in thread Is it possible to trigger a mouse click action in a browser using Perl?

From the DOM HTML Level One Spec, where click() is

click: Simulate a mouse-click. For INPUT elements whose type attribute has one of the following values: "Button", "Checkbox", "Radio", "Reset", or "Submit".
This method has no parameters.
This method returns nothing.
This method raises no exceptions.
at
  • Comment on Re^5: Is it possible to trigger a mouse click action in a browser using Perl?

Replies are listed 'Best First'.
Re^6: Is it possible to trigger a mouse click action in a browser using Perl?
by Anonymous Monk on Aug 14, 2009 at 11:56 UTC
    That is hysterical. If you go strictly by the RFC, you would use dispatchEvent, but since you are using Microsoft Windows OLE Automation use
    $obj->fireEvent("onclick");
      Yes, Microsoft is not known for following standards. The OP indeed can use the click method to browse to those links as Microsoft extends the functionality of click() to other, non-INPUT elements. I have to concede that I foolishly thought Microsoft would follow the standards their own documentation links to.

      fireEvent is a method in Microsoft's DOM, not something specific to OLE Automation, and from what I can tell it doesn't perform the default action of the event on the element (in the case of AnchorElement->onclick, browsing to href), just any custom event handlers attached to event on that element. So if the OP's page had a:hrefs like 'javascript:.*' instead of onclick handlers, using fireEvent would not work for them.
        Thanks everyone, I have got the pages required through get(javascript:code). But the click() dint work. Anyways..
        Thanks again.
        Eshwar.