Jump to content

How to click a SPAN link with no text


Recommended Posts

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

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 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

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 by tonyrocks
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...