Jack023 Posted December 6, 2013 Share Posted December 6, 2013 Hey all, I'm trying to get a part outside a html file : I tried stringregexp but i don't get it, maybe easier ways? Here is the code: $url = "http://www.mysite.com/" $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") ; or : ; $oHTTP = ObjCreate("Microsoft.XMLHTTP") $oHTTP.Open("GET", $url, 0) $oHTTP.Send() $txt = $oHTTP.Responsetext $oHTTP = 0 $return = StringRegExp($txt, 'cols=60 wrap>(.*?)<textarea><form') ;~ MsgBox(0, "" , $txt) MsgBox(0, "", $return) It's something diffrent then my other thread and has nothing to do with it Just a little note. Link to comment Share on other sites More sharing options...
karlkar Posted December 6, 2013 Share Posted December 6, 2013 (edited) Hello. It would be easier if you could paste some html code - the part you want to extract the data from. And please write what this code shows in msgbox. Edited December 6, 2013 by karlkar Link to comment Share on other sites More sharing options...
Jack023 Posted December 6, 2013 Author Share Posted December 6, 2013 It's showing the html code of the page. </p>D S Technical Solutions A Plus Core Test Pro 3.3f14<br><br><textarea rows=8 cols=59>s/n: 12022002 s/n: 12022002</textarea><br><form action="/abuse.php" method="post" target="_blank"><input type="hidden" name="id" value="18851777"><input type="hidden" name="serialname" value="D S Technical Solutions A Plus Core Test Pro 3.3f14"><input type="submit" name="send" value="Send Abuse"></form><BR><BR><BR> <center>Copyright Serials.BE c 2006, All rights reserved.</center> Like as a example, i want the things between cols=59?s/n: and </textarea> Link to comment Share on other sites More sharing options...
karlkar Posted December 6, 2013 Share Posted December 6, 2013 (edited) Ok. You can try doing as you have tried, but with a little change: $return = StringRegExp($txt, 'cols=\d+>(.*?)</textarea>', 1) MsgBox(0, "", $return[0]) StringRegExp without second parameter returns only 0 or 1 if it found text that match regular expression. Second parameter set to 1 makes it return Array of matches. You can read about it in docs. You can also use different regexp: <textarea.*>(.*?)</textarea> Edited December 6, 2013 by karlkar Link to comment Share on other sites More sharing options...
Jack023 Posted December 6, 2013 Author Share Posted December 6, 2013 works thanks Link to comment Share on other sites More sharing options...
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