Jump to content

[Solved] How can I click a data-clickID?


Recommended Posts

Is it possible to get a collection of the data-clickID?

Capture.thumb.PNG.14bea72b0a3912c9872e1aa965bbd5eb.PNG

I would like to find the B-1-4-0-0-2-1-1-0-0-1-0-0 and click it. (At least try to click it.)

Local $oLinks = _IETagNameGetCollection($oIE,"Div")
    Local $iNumLinks = @extended
    Local $sTxt = $iNumLinks & " links found" & @CRLF & @CRLF
    For $oLink In $oLinks
        $sTxt &= $oLink & @CRLF
    Next
    MsgBox($MB_SYSTEMMODAL, "Text:", $sTxt)
    ClipPut($sTxt)

I use this but $oLink.classname or $oLink.id are not working.

Edited by SkysLastChance

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

Link to comment
Share on other sites

Maybe something like:

#include <IE.au3>

Local $oIE = _IECreate("www.domain.com")
_IELoadWait($oIE)
Local $oDivs = _IETagNameGetCollection($oIE, "div")
Local $sTxt = @extended & " divs found" & @CRLF & @CRLF
For $oDiv In $oDivs
    If $oDiv.ClassName = "wp1ImageRef" Then
        $sTxt &= $oDiv.GetAttribute("data-clickId").value
    EndIf
Next
MsgBox($MB_SYSTEMMODAL, "Text:", $sTxt)
ClipPut($sTxt)

 

Link to comment
Share on other sites

It might already be telling you the coordinates to click at. See the "-427px" and "-48px" and the "width: 20px" and "height: 16px". Attempt clicking at -417, -40. 

If that fails perhaps try appending the url that starts with "images/" to the base url and navigate to that.

Link to comment
Share on other sites

Try StringInStr.  I don't know maybe there's 2 spaces, or some other chars.

Edit I do not believe you need to have .value with .getAttribute.  In any case insert some ConsoleWrite, so you know if the right .className is found...

Edited by Nine
Link to comment
Share on other sites

Sorry wrote it on the fly as I was in the middle of something, Nine is correct, just add the space and remove the .value and it should work (worked on a test file I created anyway).

#include <IE.au3>

Local $oIE = _IECreate("www.domain.com")
_IELoadWait($oIE)
Local $oDivs = _IETagNameGetCollection($oIE, "div")
Local $sTxt = @extended & " divs found" & @CRLF & @CRLF
For $oDiv In $oDivs
    If $oDiv.ClassName = " wp1ImageRef" Then
        $sTxt &= $oDiv.GetAttribute("data-clickId")
    EndIf
Next
MsgBox($MB_SYSTEMMODAL, "Text:", $sTxt)
ClipPut($sTxt)

 

Link to comment
Share on other sites

Thank you for the help!

I went with.

Local $oDivs = _IETagNameGetCollection($oIE, "div")
Local $sTxt = @extended & " divs found" & @CRLF & @CRLF
For $oDiv In $oDivs
    If StringStripWS($oDiv.ClassName,3) = "wplImageRef" Then
        $sTxt &= $oDiv.GetAttribute("data-clickId")
    EndIf
Next
MsgBox($MB_SYSTEMMODAL, "Text:", $sTxt)
ClipPut($sTxt)

 

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

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