Jump to content

Stringsplit?


Recommended Posts

Hey,

hope this helps.

You can do it using INetGet and String* functions

$sURL = "http://www.autoitscript.com"


InetGet($sURL, "source.html")
$String = FileRead("source.html")

$aMatch = StringRegExp($String, "<a.+?href=[\x22\x27](.*?)[\x22\x27].*?", 3) ; to get the URL's
If Not IsArray($aMatch) Then Exit 1

For $i = 0 To UBound($aMatch) - 1
;~  ConsoleWrite("A HREF [" & $i & "]   " & $aMatch[$i] & @CRLF)
    If StringInStr($aMatch[$i], "=") Then ; check if there is a = char we can split on
        $nString = StringSplit($aMatch[$i], '=') ; split the url, $nString[0] will contain the number of elements which we can use to get the last one
        ConsoleWrite("Part:     " & $nString[$nString[0]] & @CRLF) ; get the last query string element
    EndIf
NextoÝ÷ Úî²)à¶û§rبƮ¶­sb6æ6ÇVFRfÇC´RæS2fwC°  ¢b33c¶ôRÒôT7&VFRgV÷C¶GG¢ò÷wwræWFöG67&6öÒgV÷C²Â¢b33c¶ôÆæ·2ÒôTÆæ´vWD6öÆÆV7Föâb33c¶ôR¤f÷"b33c¶ôÆæ²âb33c¶ôÆæ·0£·â6öç6öÆUw&FRgV÷C´$Tb²gV÷C²fײb33c¶fײgV÷CµÒgV÷C²fײb33c¶ÖF6²b33c¶Òfײ5$Äb b7G&ætå7G"b33c¶ôÆæ²æ&VbÂgV÷C³ÒgV÷C²FVâ²6V6²bFW&R2Ò6"vR6â7ÆBöà b33c¶å7G&ærÒ7G&æu7ÆBb33c¶ôÆæ²æ&VbÂb33³Òb33²²7ÆBFRW&ÂÂb33c¶å7G&æu³ÒvÆÂ6öçFâFRçVÖ&W"öbVÆVÖVçG2v6vR6âW6RFòvWBFRÆ7BöæP 6öç6öÆUw&FRgV÷Cµ'C¢gV÷C²fײb33c¶å7G&æu²b33c¶å7G&æu³ÕÒfײ5$Äb²vWBFRÆ7BVW'7G&ærVÆVÖVç@ VæD`¤æW

Edit: added IE example

Edited by Robjong
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...