Kyme Posted July 28, 2010 Posted July 28, 2010 hi guys i have little problem with strings and linkgetcollection i want to use _IELinkGetCollection and then use an filter by string of very url found to get only www.xxxxxxx.com/something/ and i don't know how to use array for search the collection can anybody please help me with this? thank you very much regards, emanuel
Kyme Posted July 28, 2010 Author Posted July 28, 2010 hi guys i have atlast made this but i have an problem, i don't know how to put 2 scripts in 1 i have this #include <IE.au3> $oIE = _IECreate("http://www.hi5.com/friend/viewFriends.do") $nOffset = 1 $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks Sleep(10) $findlink = StringInStr($oLink.href, "http://www.hi5.com/friend/p") And StringRight($oLink.href, 6)="--html" $done=StringReplace ( $oLink.href, "http://www.hi5.com/friend/p" , "") If $findlink = 0 Then Sleep(10) Else ;~ MsgBox(0,$oLink.href,$done) $file = FileOpen("friends.txt", 1) FileWrite($file,$done & @CRLF) FileClose($file) EndIf Next and this one $array = StringRegExp($done, '--(?i)(.*?)--(?i)html', 1, $nOffset) If @error = 0 Then $nOffset = @extended Else EndIf for $i = 0 to UBound($array) - 1 $finish0=StringReplace ( $done, $array[$i] , "") $finish=StringReplace ( $finish0, "----html" , "") msgbox(0, "" & $i, $finish) Next for example string it's "http://www.hi5.com/friend/p15177110--Flaviu--html" the first one give me "p15177110--Flaviu--html" and the secound one delete "--Flaviu--html" but i have try to make one scrit and only first link delete the "--Flaviu--html" then stop doing this and i don't have any clue,here is my final script expandcollapse popup#include <IE.au3> $oIE = _IECreate("http://www.hi5.com/friend/viewFriends.do") $nOffset = 1 $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks Sleep(10) $findlink = StringInStr($oLink.href, "http://www.hi5.com/friend/p") And StringRight($oLink.href, 6)="--html" $done=StringReplace ( $oLink.href, "http://www.hi5.com/friend/p" , "") If $findlink = 0 Then Sleep(10) Else ;~ MsgBox(0,$oLink.href,$done) $array = StringRegExp($done, '--(?i)(.*?)--(?i)html', 1, $nOffset) If @error = 0 Then $nOffset = @extended Else EndIf for $i = 0 to UBound($array) - 1 $finish0=StringReplace ( $done, $array[$i] , "") $finish=StringReplace ( $finish0, "----html" , "") msgbox(0, "" & $i, $finish) Next $file = FileOpen("friends.txt", 1) FileWrite($file,$done & @CRLF) FileClose($file) EndIf Next i think it's problem with secound for segment, or it's 2nd segment it's in first one, can anybody help me with this one? i really don't know how to fix it:(( thank you
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