dragan Posted March 16, 2013 Posted March 16, 2013 (edited) How do I get the "data-toggle" value from a link like this:<a href="www.google.com" title="" data-toggle="True">google</a>?And I'm getting all the link elements using:Local $AllLinks = _IETagNameGetCollection($oIE, 'a') For $theLink in $AllLinks If $theLink.data-toggle = 'True' then MsgBox(0, '', 'Toggle is True') Nexthowever, I do not know how to form that $AllLinks.data-toggle, since autoit cannot form data value such as that. Edited March 16, 2013 by dragan
Exit Posted March 16, 2013 Posted March 16, 2013 If $theLink .data-toggle = 'True' .... App: Au3toCmd UDF: _SingleScript()
dragan Posted March 16, 2013 Author Posted March 16, 2013 (edited) it was just a typo, sorry. Anyway, that's not the problem. You cannot type "-" as a value, that's the real problem. Edited March 16, 2013 by dragan
Exit Posted March 16, 2013 Posted March 16, 2013 PerhapsIf $theLink.&"data-toggle" = 'True' App: Au3toCmd UDF: _SingleScript()
dragan Posted March 16, 2013 Author Posted March 16, 2013 I get ERROR: syntax error on that spot with .& next to a variable
Solution FireFox Posted March 16, 2013 Solution Posted March 16, 2013 Perhaps If $theLink.&"data-toggle" = 'True' These are objects, you can not manipulate them by this manner. @dragan #include <IE.au3> $oIE = ... Local $oLinks = _IETagNameGetCollection($oIE, "a") For $oLink In $oLinks ConsoleWrite($oLink.getAttribute("data-toggle") & @CrLf) Next _IEQuit($oIE)
dragan Posted March 16, 2013 Author Posted March 16, 2013 These are objects, you can not manipulate them by this manner. @dragan #include <IE.au3> $oIE = ... Local $oLinks = _IETagNameGetCollection($oIE, "a") For $oLink In $oLinks ConsoleWrite($oLink.getAttribute("data-toggle") & @CrLf) Next _IEQuit($oIE) That's perfect. Thank you!
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