pezo89 Posted September 16, 2013 Posted September 16, 2013 hi, i am just wondering how can i set these two numbers up against eachother? and the highest number gets written down? i am a semi-newb when it comes to Au3 coding, and it has been a year since last time two nummbers, the Class ID will be the same, just the "%" will change <div class="positions_sentiment_positionType_percentage positions_sentiment_positionType1_percentage">78%</div> <div class="positions_sentiment_positionType_percentage positions_sentiment_positionType2_percentage">22%</div> iv been able to exstract the data with this code For $div In $divs If $div.className == "positions_sentiment_positionType_percentage positions_sentiment_positionType1_percentage" Then MsgBox(0,"percentage",$div.innertext) ;:::::::::::::::::::::::::::::::::::::::: EndIf Next
mikell Posted September 16, 2013 Posted September 16, 2013 (edited) The _Max func in the integrated udf Math.au3 should work Else (also works if more than 2 values) #include <Array.au3> $str = '<div class="positions_sentiment_positionType_percentage positions_sentiment_positionType1_percentage">78%</div>' & @crlf & _ '<div class="positions_sentiment_positionType_percentage positions_sentiment_positionType2_percentage">22%</div>' $res = StringRegExp($str, '(?s)<div.+?percentage">(\d+)%', 3) Msgbox(0,"", _ArrayMax($res, 1) & " %") Edited September 16, 2013 by mikell
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