Jump to content

Recommended Posts

Posted

What did you pass to the function

_IETagNameGetCollection($oIE,'a')

as a first parameter ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 2 weeks later...
Posted

Hello mLipok,

I found the solution of my problem ...

Local $oLinks = _IELinkGetCollection ($oIE)
Local $iNumLinks = @extended

For $i=0 to ($iNumLinks - 1)
   $oLink = _IELinkGetCollection($oIE,$i)
   If $oLink.href = "javascript:OpenPage('default.asp')" Then
         _IELinkClickByIndex($oIE, $i )
        Exit
   EndIf
Next

I have a doubt this works ?!

Local $oIE2 = _IELinkClickByIndex($oIE, $i )

Thank you for your help!

Posted (edited)
Local $oLinks = _IELinkGetCollection($oIE)
Local $iNumLinks = @extended
Local $oLink = Null

For $i = 0 To ($iNumLinks - 1)
    $oLink = _IELinkGetCollection($oIE, $i)
    If $oLink.href = "javascript:OpenPage('default.asp')" Then
        _IELinkClickByIndex($oIE, $i)
        Exit
    EndIf
Next

; here is equivalent 1
For $iLink_idx = 0 To ($iNumLinks - 1)
    If $oLinks.Item($iLink_idx).href = "javascript:OpenPage('default.asp')" Then
        _IELinkClickByIndex($oIE, $iLink_idx)
        Exit
    EndIf
Next


; here is equivalent 2
For $oLink_enum In $oLinks
    If $oLink_enum.href = "javascript:OpenPage('default.asp')" Then
        _IEAction($oLink_enum, 'click')
        ExitLoop
    EndIf
Next

; or even this:
For $oLink_enum In $oLinks
    If $oLink_enum.href = "javascript:OpenPage('default.asp')" Then
        $oLink_enum.Click()
        ExitLoop
    EndIf
Next

 

 

EDIT:
What you expect here:

  On 1/6/2016 at 10:42 AM, boy233 said:

I have a doubt this works ?!

Local $oIE2 = _IELinkClickByIndex($oIE, $i )

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Perfect this works ....: D

How can I solve this problem?

Local $oIE2 = _IELinkClickByIndex($oIE, $i )
_IENavigate($oIE2, "http://intranet/new_page.asp")

--> IE.au3 T3.0-1 Error from function _IENavigate, $_IESTATUS_InvalidDataType

Posted

What's happen when you use this:

Local $oIE2 = _IELinkClickByIndex($oIE, $i )

??

New tab / New IE in separate window / just page goes to the desired content ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

so use 

_IEAttach(,,,)

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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
×
×
  • Create New...