Negative1 Posted June 23, 2010 Share Posted June 23, 2010 (edited) Hi all, Here is a snippet of my code in which i am using linkgetcollection to find all the links and then i want to search for the string "ad=" I'm very new to object programming and I know the problem is in my understanding of $oLink.href which I took from the example. so may question really boils down to: "how do I get the link string of the link I am currently indexing in my for loop?" $oIE= _IEAttach("", "instance",1) $oLinks = _IELinkGetCollection ($oIE) $iNumLinks = @extended For $x=0 to $iNumLinks if stringinstr($oLink.href,"ad=") Then _IELinkClickByIndex($oIE,$x) EndIf Next Thanks all, -1 Edited June 23, 2010 by Negative1 What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world. Link to comment Share on other sites More sharing options...
EnderWiggin Posted June 23, 2010 Share Posted June 23, 2010 I was just prowling the forum hoping I'd find something on how to manipulate the object from _ielinkgetcollection. I was hoping it would behave like an array (figured those out yesterday, hopefully). But so far, no dice. If you figure this out or even get anything useful on how to manipulate the resulting object, please report back here. I'll keep looking and let you know if I see anything. Link to comment Share on other sites More sharing options...
EnderWiggin Posted June 23, 2010 Share Posted June 23, 2010 I think for my problem, I can just write each line to a file as in the following subsection of my code. #include <Array.au3> #include <File.au3> #include <IE.au3> $hfile=FileOpen(@UserProfileDir & "\" & @yday & " " & @hour & @MIN & " " & "diamonds.txt", 1) $oIE = _IECreate ("chess.com") $oLinks = _IELinkGetCollection ($oIE) $iNumLinks = @extended MsgBox(0, "Link Info", $iNumLinks & " links found") For $oLink In $oLinks Filewrite($hfile, $oLink.href) FileWrite($hfile, "" & @CRLF) Next FileClose($hfile) In your case, it seems you really just want to transform the object into an array-- I only wanted to get an array because I'd figured out how to enumerate an array into a textfile. Could you use: "_ArrayAdd" in the same iterative style to export the object into an array variable of your choosing? Then you could call any link as you'd expect with $aYourArray, if I understand correctly. I'm probably not capable of being helpful yet, but I suppose free bump for you at least. Cheers, and good luck Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now