Hi,
The function _IELinkGetCollection returns an object collection not an array, you will have to change the Navigate function logic or convert the collection to an array first.
Edit: Yes, you are correct, take a look at the ParseLinks function in the script below.
#include <IE.au3>
Global $g_oIE = _IECreate('http://www.example.com')
Global $g_listOfLinks
Main()
Func Main()
ParseLinks() ; get an array of links from the page
Navigate(10)
EndFunc ;==>Main
Func Navigate($iNavCount)
For $i = 1 To $iNavCount Step 1
$iIndex = Random(0, UBound($g_listOfLinks) - 1, 1)
$sLink = $g_listOfLinks[$iIndex]
Sleep(3000)
Next
EndFunc ;==>Navigate
; Return values on success: an array of links and sets @extended to link count
; Return values on failure: 0 and sets @error to non-zero
Func ParseLinks()
Local $aLinks[1000], $n = 0
Local $oLinks = _IELinkGetCollection($g_oIE) ; get link collection OBJECT
For $oLink In $oLinks ; loop over link collection items
$g_listOfLinks[$n] = $oLink.href ; put the url into the array
$n += 1 ; up the count
Next
ReDim $g_listOfLinks[$n] ; correct size
Return SetError(Not $n, $n, $g_listOfLinks) ; return array
EndFunc ;==>ParseLinks