Jump to content

Link on IE question


Recommended Posts

Hi,

I use following code to get link on IE

#include <IE.au3>
$oIE = _IECreate ("")
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended
MsgBox(0, "Link Info", $iNumLinks & " links found")
For $oLink In $oLinks
    MsgBox(0, "Link Info", $oLink.href)
Next

And this is my question:

1. are there attribute of $oLink like $oLink.href? plz tell me

2. Suppose it found 19 link, how to click on 3rd link ?

thanks

Link to comment
Share on other sites

Hi, study this code. It answers both your questions.

#include <IE.au3>
$ie = _IECreate("www.google.com")
$links = _IELinkGetCollection($ie)
$count = 1
For $link In $links
    If $count = 3 Then
        MsgBox(0, $link.innerText, $link.href)
        _IELinkClickByText($ie, $link.innerText)
        ExitLoop
    EndIf
    $count += 1
Next

:)

Broken link? PM me and I'll send you the file!

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