Jump to content

noob help with _IEImgClick


Orangey
 Share

Recommended Posts

  • Moderators

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
Link to comment
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

Link to comment
Share on other sites

  • 2 weeks later...
  • Moderators

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