PartyPooper Posted April 22, 2014 Posted April 22, 2014 Is it possible to extract the version number from the following webpage? http://forum.rustoxide.com/resources/rustrcon-admin-tool-32-bit.434/ What I'm looking for is a way to consistently extract the version string (currently '2014.3.7.3762'). Sorry, I can't provide a function example because I have no idea on where to begin having never interacted with styled webpages before. I haven't been able to find a UDF in the Help file that finds a particular line in a webpage (at least not yet). I was thinking about putting the entire page into an array after removing all whitespace and simply searching for the array index that contains <h1>RustRCON Admin Tool (32 bit) <span class="muted">, however, I don't know if this is the right (or even correct) method to use. Pointers would be appreciated.
Danp2 Posted April 22, 2014 Posted April 22, 2014 You could use InetRead to get the page contents into a variable and then parse out the version info from there. Latest Webdriver UDF Release Webdriver Wiki FAQs
Solution sahsanu Posted April 23, 2014 Solution Posted April 23, 2014 Hello, Something like this could work: $bSource = InetRead("http://forum.rustoxide.com/resources/rustrcon-admin-tool-32-bit.434/") $sSource = BinaryToString($bSource) $aVersion = StringRegExp($sSource, "(?i)<h3>Version\s(.+?)</h3>", 1) ConsoleWrite("Current version is: " & $aVersion[0] & @CRLF) Cheers, sahsanu
PartyPooper Posted April 23, 2014 Author Posted April 23, 2014 Thanks Sahsanu, I wouldn't have believed it could be done in 4 lines
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