Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

_IELinkClickByText


  • Please log in to reply
3 replies to this topic

#1 Amon

Amon

    Seeker

  • New Members
  • 4 posts

Posted 17 August 2006 - 08:31 PM

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? :P

thanks in advance

best regards

amon







#2 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,988 posts

Posted 17 August 2006 - 08:54 PM

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? :P

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


#3 Amon

Amon

    Seeker

  • New Members
  • 4 posts

Posted 19 August 2006 - 08:17 PM

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

#4 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,988 posts

Posted 20 August 2006 - 12:58 AM

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

Ah 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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users