DigitalLocksmith Posted June 10, 2007 Posted June 10, 2007 (edited) Ok, here's the deal....I've successfully gotten this to load up the first page of friends, extract the links, search the source of every profile on the first page for my friendID, and populate the matching data into array2...Here's the issue. When it switches to page 2 after populating array2, it doesn't perform the link extraction and source search on any page after the first. It just keeps cycling through the pages and displays the incomplete arrays. What am I doing wrong with the loop? CODE#include <IE.au3> #include<Array.au3> #include<File.au3> #include<String.au3> #include <INet.au3> Dim $avArray[1] Dim $avArray2[1] $i = 2 Global $friendID = "32406107" Global $oIE = _IECreate("http://friends.myspace.com/index.cfm?fuseaction=user.viewfriends&friendID=" & $friendID) $oLinks = _IELinkGetCollection($oIE) Global $sHref = "profile" While $i <= 5;;;;;;;;;;;;;;;;;;;;;;;;;;;; For $oLink In $oLinks _ArrayAdd($avArray, $oLink.href) If StringInStr(String($oLink.href), $sHref) Then EndIf If StringInStr(_INetGetSource($oLink.href), '32406107') > 0 Then _ArraySearch($avArray2, $oLink.href, 0, 0, 0, True) If @error Then _ArrayAdd($avArray2, $oLink.href) EndIf Next $oLinks = _IELinkGetCollection($oIE) $oSubmit = "java script:__doPostBack('ctl00$cpMain$pagerTop','" & $i & "')" _IENavigate($oIE, $oSubmit) $i = $i + 1 WEnd _ArrayDisplay($avArray, "Whole array") _ArrayDisplay($avArray2, "Whole array") Edited June 10, 2007 by DigitalLocksmith
Mast3rpyr0 Posted June 10, 2007 Posted June 10, 2007 You never set a value to $oLink, it is just initialized in your for loop. Try: For $oLink = 1 To $oLinks ... Next My UDF's : _INetUpdateCheck() My Programs : GameLauncher vAlpha, InfoCrypt, WindowDesigner, ScreenCap, DailyRemindersPick3GeneratorBackupUtility! Other : Bored? Click Here!
DigitalLocksmith Posted June 10, 2007 Author Posted June 10, 2007 (edited) No, that's not it either because I think the _IELinkGetCollection isn't working when I do this so it ends up being a completely empty array....I'm stumped, but I'll keep trying...Is _ArrayAdd overwriting $array, or does it always append to the end? Edited June 10, 2007 by DigitalLocksmith
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