Dent Posted September 8, 2016 Posted September 8, 2016 (edited) I just can't get my head around what I'm trying to do. Ok so I read all the links in a webpage into a 1D array, I then make the array unique as there are some duplicates. I then find all the entries I want from the array and put the number of the row for those entries into another 1D array. So I now have two arrays; one has unique links, the other has the numbers of the rows for the links I actually want. Using the second array I would like to amend the first array, or create a third, with just the links I actually want. Confused? Welcome to my world. I'll put the relevant section of code below to show where I am up to. I've left the _ArrayDisplay in the above code which I am using to check the code does what I wanted. So the above code works fine, I'm just stumped on how to extract the links from $aLinks that I want. $oLinks = _IELinkGetCollection($oIE) Local $aLinks[1] = ["Link"] For $oLink in $oLinks _ArrayAdd($aLinks, $oLink.href) Next ;_ArrayDisplay($aLinks) $aLinks = _ArrayUnique($aLinks) ;_ArrayDisplay($aLinks) $aLinksToClick = _ArrayFindAll($aLinks, "azref", 0, 0, 0, 3) ;_ArrayDisplay($aLinksToClick) Local $aSortedLinks[1] = ["Sorted Links"] For $i = 0 To UBound($aLinksToClick) - 1 $Blah = _ArrayExtract($aLinks, $aLinksToClick[$i], $aLinksToClick[$i]) _ArrayAdd($aSortedLinks, $Blah) Next Edited September 8, 2016 by Dent To include solution
AutoBert Posted September 8, 2016 Posted September 8, 2016 Name URL or post the copied data from the array!
Dent Posted September 8, 2016 Author Posted September 8, 2016 23 minutes ago, AutoBert said: Name URL or post the copied data from the array! Original post edited
Dent Posted September 8, 2016 Author Posted September 8, 2016 Solved it myself in the end, for some reason I didn't see the _ArrayExtract command earlier. Edited the code to include the solution.
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