Method of element identification and emulation of click event

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ZZyZX

    Method of element identification and emulation of click event

    I wish to uniquely identify the below button element embedded
    among many other button elements in a web page and call the click
    event on it to automatically navigate to the next page in a
    sequence of pages. Similar in action to automated login.

    <INPUT class=submitn onclick="window .location='/newstuff?
    newstuffupdate= prefs&amp;type= cfilter&amp;ind ex=1&amp;from=z zyzx'"
    type=button value="Search Now">


    Since the above button element has no id or name tag I can't see
    any way of success with;
    var tag=document.ge tElementById("f oo").click()" ;

    Also, if it matters, this input element and many others of the
    class=submitn are not wrapped in a <form</formblock, they do
    all reside in a <div</divblock.


    does have a close approximation of what could be used.

    Under heading - getElementsByNa me(name)

    <div name="george">f </div>
    <div name="george">f </div>

    <script type="text/javascript">
    var georges=documen t.getElementsBy Name("george")
    for (i=0; i< georges.length; i++)
    // do something with each DIV tag with name="george". Firefox only.
    </script>

    but the above still leaves the identification of the input
    button unsolved.

    Any insights or suggestions?
  • ZZyZX

    #2
    Re: Method of element identification and emulation of click event

    It should be added that the client browser is written in java with IE
    engine embedded in a java ContentPane. The client user may inject into
    any rendered webpage any javascript that a user may wish as though the
    injected script were part of the original downloaded webpage.

    Comment

    Working...