cburak Posted January 7, 2014 Posted January 7, 2014 (edited) Hey guys! Iam trying to get an information in a website with usefull UDF IE.au3. I need a little help. <li> <a href="myacc"> <div class="notification">1</div> <img src="http://cdn.example.com/img/my_acc.png" alt="My Account"> <span>my accs</span> </a> </li> <li> <a href="mysets"> <div class="notification">3</div> <img src="http://cdn.example.com/img/my_sets.png" alt="My Sets"> <span>my sets</span> </a> </li> So there is 2 information Iam trying to get: 1. There is 1 notification in "myacc" 2. There is 3 notification in "mysets" If I figure out how should I get notification in "myaccs" then I can get the other one same way I dont know how to get it because I dont know what kind a property is this ">1<" or is it even a property. Iam trying to reach those separetly. Here is what did I do so far: $oIE = _IECreate("http://example.com/") Login() Check() Func Check() Local $oA, $oAs = _IETagNameGetCollection($oIE, 'a') For $oA In $oAs If String($oA.href) = "myacc" Then Local $oDiv, $oDivs = _IETagNameGetCollection($oA, 'div') For $oDiv In $oDivs If String($oDiv.classname) = "notification" Then ;There is need be some code to get how many notifications. I mean ">1<" part. Else MsgBox(1,"failed","exit") ExitLoop EndIf Next Else ;MsgBox(1,"fail2","try2") EndIf Next MsgBox(1,"didnt find anything","??") EndFunc Iam new about objects so my way could be way too lame. Any improvement and suggestions are much appreciated. Thanks! Edited January 7, 2014 by cburak
Solution Danp2 Posted January 7, 2014 Solution Posted January 7, 2014 Have you tried _IEPropertyGet($oDiv, "innertext")? Latest Webdriver UDF Release Webdriver Wiki FAQs
cburak Posted January 7, 2014 Author Posted January 7, 2014 Have you tried _IEPropertyGet($oDiv, "innertext")? Thank you! Works like charm:)
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