tonyrocks Posted June 9, 2014 Share Posted June 9, 2014 I'm in the process of writing a script that clicks on the first link in a list, which brings up another pop-up and then closes that pop up. The previous first link disappears and is replaced with the next in line...repeat process. My problem is this, I cannot seem to figure out how to click the link, which contains no text, but appears to be using some css to display an image. Below is the example row with a link: <div class="action"><a class="button-small" href="#"><span class="category system"></span></a></div> I'm thinking I could use something with _IELinkClickByText($oIE, "#") ...but not sure. Thanks! -Tony Link to comment Share on other sites More sharing options...
jdelaney Posted June 9, 2014 Share Posted June 9, 2014 (edited) Use the _IE function to grab all span, then loop through, and match off the class attribute: _IETagNameGetCollection For $oNode In $oNodes Consolewrite($oNode.className() & @crlf) NExt Edited June 9, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
tonyrocks Posted June 9, 2014 Author Share Posted June 9, 2014 (edited) Ok, so what i did was just add some text (zap...yeah, very creative, i know). And used the: _IELinkClickByText($oIE, "zap") This works and brings up a dynamically generated pop-up (div, not javasript alert). I want to then click a link on that pop-up that says "Accept." Clicking that link disposes of that pop-up. However I this doesn't work:# #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate("http://localhost/myapp") ; Display messages _IELinkClickByText($oIE, "zap") ;wait _IELoadWait ($oIE, 20, 3000) ;Click the accept button on pop-up. After clicking Accept, the pop-up goes away _IELinkClickByText($oIE, "Accept") It doesn't seem to know how to click Accept. Am I missing something? Edited June 9, 2014 by tonyrocks Link to comment Share on other sites More sharing options...
Palestinian Posted June 10, 2014 Share Posted June 10, 2014 This might be just my sleeping brain talking, but didn't you say that the Accept link is in a pop-up? doesn't that mean that _IELinkClickByText($oIE, "Accept") is trying to click a link called Accept on the 1st page and not the pop-up itself? 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