Amon Posted August 17, 2006 Share Posted August 17, 2006 Hello, I have some problems to "Click" on Text Links wich contains no href attribute, but only a 'onclick' event: <tr><td><a onclick="jump('character');" style="cursor:pointer;">Character</a> </td> Why can't I get acces to this Link by: _IELinkClickByText ($oIE_game, "Character",0,0) _IELoadWait ($oIE_game, 20, 3000) ist there any workaround? I tried it with _IELinkGetCollection but there are also these links missing.... with _IETagNameGetCollection ($oIE_game, "a") I am able to get all "a" tags, but then is the question - how do i get access to the specific onclick-attribute (?) - and how can i simulate a klick on it? thanks in advance best regards amon Link to comment Share on other sites More sharing options...
DaleHohm Posted August 17, 2006 Share Posted August 17, 2006 Hello, I have some problems to "Click" on Text Links wich contains no href attribute, but only a 'onclick' event: <tr><td><a onclick="jump('character');" style="cursor:pointer;">Character</a> </td> Why can't I get acces to this Link by: _IELinkClickByText ($oIE_game, "Character",0,0) _IELoadWait ($oIE_game, 20, 3000) ist there any workaround? I tried it with _IELinkGetCollection but there are also these links missing.... with _IETagNameGetCollection ($oIE_game, "a") I am able to get all "a" tags, but then is the question - how do i get access to the specific onclick-attribute (?) - and how can i simulate a klick on it? thanks in advance best regards amon _IELinkClickByText and _IELinkGetCollection use the document.links collection. This collection is defined as "A collection of all a and area elements that have assigned href attributes that make them behave as links (instead of only anchors)". So what you describe makes sense. Your approach to this will need to use the _IETagNameGetCollection function just as you have and will need to look something like this: $oLinks = _IETagNameGetCollection ($oIE_game, "a") For $oLink in $oLinks If $oLink.innerText = "Character" Then _IEAction($oLink, "click") ExitLoop EndIf Next Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Amon Posted August 19, 2006 Author Share Posted August 19, 2006 Your approach to this will need to use the _IETagNameGetCollection function just as you have and will need to look something like this: $oLinks = _IETagNameGetCollection ($oIE_game, "a") For $oLink in $oLinks If $oLink.innerText = "Character" Then _IEAction($oLink, "click") ExitLoop EndIf Next Dale Thank you for your hint, it just needed a tiny completion: If string($oLink.innerHTML) = "Character" Then I must be converted to a string, otherwise it returns 0 / NULL best regards Amon Link to comment Share on other sites More sharing options...
DaleHohm Posted August 20, 2006 Share Posted August 20, 2006 Thank you for your hint, it just needed a tiny completion: If string($oLink.innerHTML) = "Character" Then I must be converted to a string, otherwise it returns 0 / NULL best regards AmonAh yes, i do that in the UDF but easily forget about it. If the property is NULL, it returns numeric 0... a numeric comparison of 0 to any string returns True. Good catch. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
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