Jump to content
Sign in to follow this  
Orangey

noob help with _IEImgClick

Recommended Posts

Something like this should work for you.

#include <IE.au3>

$sURL = "http://www.autoitscript.com"
$oIE = _IECreate($sURL)
$oImgs = _IETagNameGetCollection($oIE, "IMG")
For $oImg In $oImgs
    If StringInStr($oImg.src, "autoit_builder_wall_thumb.jpg") Then
        $oParent = $oImg.parentElement
        If $oParent.tagName = "A" Then
            $sLink = $oParent.href
            ConsoleWrite($sLink & @CR)
        EndIf
    EndIf
Next

Share this post


Link to post
Share on other sites

Something like this should work for you.

#include <IE.au3>

$sURL = "http://www.autoitscript.com"
$oIE = _IECreate($sURL)
$oImgs = _IETagNameGetCollection($oIE, "IMG")
For $oImg In $oImgs
    If StringInStr($oImg.src, "autoit_builder_wall_thumb.jpg") Then
        $oParent = $oImg.parentElement
        If $oParent.tagName = "A" Then
            $sLink = $oParent.href
            ConsoleWrite($sLink & @CR)
        EndIf
    EndIf
Next
One other thing, if I wanted to find the link inside a hyperlink... Say I'm on the AutoIt homepage again, and I want to find the link associated with mailing list would that also be possible with the above code?

Thanks

Share this post


Link to post
Share on other sites

Sorry for the late reply, but this sould accomplish what you are wanting.

#include <IE.au3>

$sURL = "http://www.autoitscript.com"
$oIE = _IECreate($sURL)
$oLinks = _IELinkGetCollection($oIE)
For $oLink In $oLinks
    If String($oLink.outerText) = "mailing list" Then
        $sLink = $oLink.href
        ConsoleWrite($sLink & @CR)
    EndIf
Next

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  

×
×
  • Create New...