Jump to content
Sign in to follow this  

[SOLVED] Read link text (with IE UDF)

Recommended Posts

Here's a html on my website to use as example:


(please excuse the ads and popup, it's one of those "free" hosts)

Getting links with IE UDF is easy;

$oIE = _IECreate("http://hem.passagen.se/amax/CodecControl/index.html", 0, 1, 1, 0)

$oFrame = _IEFrameGetCollection($oIE, 1)
$oLinks = _IELinkGetCollection($oFrame)
$iNumLinks = @extended
ConsoleWrite($iNumLinks & " links found" & @CRLF)
For $oLink In $oLinks
    ConsoleWrite($oLink.href & @CRLF)
    ConsoleWrite($oLink.title & @CRLF)

;~ Sleep(10000) ;To see the page


But is there a way to get the links text? ("CodecControl 2.2.8" and "CodecControl 2.2.5")

Also, any guidence on how to have some data hidden that can in one way or another be associated with the links? Abusing the "title" is kinda weak.

Edited by AdmiralAlkex

Share this post

Link to post
Share on other sites

I can't find out how :)


If the object is an element, the nodeValue returns null.

It's kind of misusing the property, but you can use .dataSrc as a custom string attribute:

#include <IE.au3>

$oIE = _IE_Example("basic")
$oLinks = _IELinkGetCollection($oIE)

$iIndex = 0
For $oLink In $oLinks
    $oLink.dataSrc = "#LinkCustomData_" & $iIndex
    $iIndex += 1

For $oLink In $oLinks
    ConsoleWrite(".innerText = " & $oLink.innerText & "; .dataSrc = " & $oLink.dataSrc & @LF)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...