Jump to content

IE Help, need to click a link with a changing name


Recommended Posts

I have a webpage, I want to click a link on this page, I can't use _IeClickLinkByText, I tried _IEFormGetCollection with no success. Also tried _IELinkGetCollection.

The problem is that the name of the button is different each time.

How do I click a link, by searching for its value, instead of looking for its name or ID?

I've been staring at the help file section about the IE commands for quite a while now and still not turned up anything, so I decided to submit and ask for help.

<div class="buttons"><br/>
<input type="hidden" id="params[from_id]" name="params[from_id]" value="1521754579" autocomplete="off" />
<input type="hidden" id="params[app_id]" name="params[app_id]" value="102452128776" autocomplete="off" />
<input type="hidden" id="params[req_type]" name="params[req_type]" value="0" autocomplete="off" />
<input type="hidden" id="params[is_invite]" name="params[is_invite]" value="0" autocomplete="off" />
<input type="submit" value="Accept" name="actions[http://ThisIsDifferentEachTime]" class="inputbutton" />
<input type="submit" value="Ignore" name="actions[reject]" class="inputbutton" />

<input type="submit" value="Accept" name="actions[http://ThisIsDifferentEachTime]" class="inputbutton" />

Is what I need to click.

Thanks for your time.

Link to comment
Share on other sites

You can identify it by its value then - value="Accept".

#include <IE.au3>
$oIE = _IEAttach ("sometihn")
$oInputs = _IETagNameGetCollection ($oIE, "input")
For $oInput In $oInputs
    If $oInput.value="Accept" then _IEAction($oInput,"click")
Next

Mind if the page have iframes and other tricky stuff like Java.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...