Sign in to follow this  
Followers 0
marines27

How I can click onimage/link?

2 posts in this topic

The part of code:

" </script></td></tr></tbody></table></nobr></fieldset></div></header><ul class="icons"><li><a href="/PSPWebClient/DataScreen.axd/1251" target="_self">
<span class="icon"><img src="./PersephoneIcon.axd?seq=652" alt="Icon" width="32" height="32" /></span>
<span class="title">Werknemers</span></a>"

I tried use ImgClick, LinkClickbytext & id.

Are other ways?

 

Share this post


Link to post
Share on other sites



Example:

#include <IE.au3>
$sHTML = _
'<HTML>' & @CRLF & _
'<BODY>' & @CRLF & _
'   <ul class="icons">' & @CRLF & _
'       <li>' & @CRLF & _
'           <a href="/2PSPWebClient/2DataScreen.axd/1251" target="_self">' & @CRLF & _
'           <span class="icon"><img src="./2PersephoneIcon.axd?seq=652" alt="Icon" width="32" height="32" /></span>' & @CRLF & _
'           <span class="title">2Werknemers</span></a>' & @CRLF & _
'       </li>' & @CRLF & _
'       <li>' & @CRLF & _
'           <a href="/2PSPWebClient/2DataScreen.axd/1251" target="_self">' & @CRLF & _
'           <span class="icon"><img src="./2PersephoneIcon.axd?seq=652" alt="Icon" width="32" height="32" /></span>' & @CRLF & _
'           <span class="title">2Werknemers</span></a>' & @CRLF & _
'       </li>' & @CRLF & _
'       <li>' & @CRLF & _
'           <a href="/PSPWebClient/DataScreen.axd/1251" target="_self">' & @CRLF & _
'           <span class="icon"><img src="./PersephoneIcon.axd?seq=652" alt="Icon" width="32" height="32" /></span>' & @CRLF & _
'           <span class="title">Werknemers</span></a>' & @CRLF & _
'       </li>' & @CRLF & _
'       <li>' & @CRLF & _
'           <a href="/2PSPWebClient/2DataScreen.axd/1251" target="_self">' & @CRLF & _
'           <span class="icon"><img src="./2PersephoneIcon.axd?seq=652" alt="Icon" width="32" height="32" /></span>' & @CRLF & _
'           <span class="title">2Werknemers</span></a>' & @CRLF & _
'       </li>' & @CRLF & _
'   </ul>' & @CRLF & _
'</BODY>' & @CRLF & _
'</HTML>'

$oIE = _IECreate("about:blank")
_IEBodyWriteHTML($oIE,$sHTML)
Sleep(500)
$oImages = _IETagNameGetCollection($oIE,"Img")
For $oImage In $oImages
    $oImage.focus
    $oImage.style.border = "thick solid #FF0000"
    If StringInStr($oImage.src,"/PersephoneIcon.axd?seq=652") Then
        $oImage.style.border = "thick solid #2C6700"
        Sleep (2000)
        $oImage.click
        ConsoleWrite("Clicked the image" & @CRLF)
        ExitLoop
    EndIf
    Sleep (2000)
Next

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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0