tom13 Posted November 7, 2007 Posted November 7, 2007 (edited) Sigh... I wrote tons of text in this thread and it somehow all got deleted after I pressed submit.. probably some forum bug when there is too much text? Okay.. I'll make it short this time. I want to get a string from a string with _StringBetween The string looks like this: "<divclass="health-stat"><h4>Health:</h4><p><span>12065</span></p></div>" So I coded this: #include <INet.au3> #include <String.au3> $url = "http://eu.wowarmory.com/character-sheet.xml?r=Stormscale&n=Sodar" $rawsource = _INetGetSource ($url) $source = StringStripWS($rawsource, 8) $health_start = "<h4>Health:</h4><p><span>" $health_end = "</span></p>" $health = _StringBetween ( $source, $health_start, $health_end) MsgBox(4096, "Test", $health, 10) But when I execute it it gives me an empty string as return.. anyone knows why or what I do wrong? It should, in the example above, return "12065" Edited November 7, 2007 by tom13
tom13 Posted November 7, 2007 Author Posted November 7, 2007 (edited) erm for some reason there is no text? I wrote so much and now there is nothing.. edit: remade it in a short version Edited November 7, 2007 by tom13
Moderators SmOke_N Posted November 7, 2007 Moderators Posted November 7, 2007 1. You need to look up "escape characters" if you are going to use the RegExp part of _StringBetween. 2. The return value is not a regular variable, it's an Array. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
tom13 Posted November 7, 2007 Author Posted November 7, 2007 1. You need to look up "escape characters" if you are going to use the RegExp part of _StringBetween.2. The return value is not a regular variable, it's an Array.thanks! didn't know I had to use an array because its only found 1 time
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