Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

String Split Problem

$
0
0
I was trying to get source code of a site & split string using a keyword and what i want is text between two of those keyword . Example , site source has some code in which there are exactly two "<somekeyword>" , i want is text between these two , <somekeyword>sometext<somekeyword> , so i want here 'sometext' . Here's my code for it -
;Get Site Source Code
$URL="somesite.com/file.htmll"
$httpObj = ObjCreate("winhttp.winhttprequest.5.1")
$httpObj.open("GET",$URL)
$httpObj.send()
$HTMLSource = $httpObj.Responsetext
;Now split using keyword
$parsed=StringSplit ( $HTMLSource, "<somekeyword>" ,0 )
$script=$parsed[1] ; I think i should get required here but i get rubbish value like tml>
<9059<!DOCTYPE <!DOCTYPE  or something!


But it gives absturd value !
My version is v3 & source code can be as large as 50Kb. Please Help fast :|

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>