BitByteBit Posted December 3, 2009 Share Posted December 3, 2009 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 More sharing options...
Juvigy Posted December 3, 2009 Share Posted December 3, 2009 Check out the IE udf examples. _IEGetObjByName + _IEAction(element / click) Should do the trick in most cases Link to comment Share on other sites More sharing options...
BitByteBit Posted December 3, 2009 Author Share Posted December 3, 2009 Oops, forgot to mention I tried that, but like I said, the name is name="actions[http://ThisIsDifferentEachTime.com/XYZ]" Any ideas? I guessed I need to search for the Value since this is the only constant. Link to comment Share on other sites More sharing options...
Juvigy Posted December 3, 2009 Share Posted December 3, 2009 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 More sharing options...
BitByteBit Posted December 3, 2009 Author Share Posted December 3, 2009 Resolved, exactly what I needed, thanks a lot! + Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now