Jump to content

Problem with _IELinkClickByText()


JBJB
 Share

Recommended Posts

Having trouble clicking a couple of controls. Most controls source looks like this:

<a href="java script:" ARID="536870909" ARType="Control" ARDBN="btnSendNotification" class="btn btn3d arfid536870909 ardbnbtnSendNotification" style="top:581; left:100; width:93; height:21;z-index:1013;"><div class="btntextdiv" style="top:0; left:0; width:93; height:21;"><div class="f1" style=";width:93">Send Notification</div>

and doing a _IELinkClickByText($oIE, "Send Notification") works fine.

There are two controls that appear to have spaces in the label, such as this Profile button:

<a href="java script:" ARID="536870910" ARType="Control" ARDBN="PeopleButton" class="btn btn3d arfid536870910 ardbnPeopleButton" style="top:89; left:249; width:55; height:21;z-index:1004;"><div class="btntextdiv" style="top:0; left:0; width:55; height:21;"><div class="f1" style=";width:55"> Profile </div>

I have tried _IELinkClickByText($oIE2, " Profile ") and _IELinkClickByText($oIE2, "Profile") and both return NoMatch.

Anyone know how to get around this?

Thanks for any help.

Link to comment
Share on other sites

Weird... I copied the code you gave and made this:

#include <IE.au3>
$oIE=_IECreate(@DesktopDir & "\New text document.html",1)
_IELinkClickByText($oIE,"Profile ")

Using " Profile " and "Profile" wouldn't work, but this does: "Profile "

From help file:

It is common practice to attach onclick Javascript events to other DOM elements to simulate the behavior of links. To activate such elements, use "click" with _IEAction.

You could also try _IELinkClickByIndex().
Link to comment
Share on other sites

I had tried _IELinkClickByIndex() before, but didn't know how to figure out the index value. I tried it again, this time putting the function inside a for ... next loop, and just watched until the right button fired. Not elegant, but it worked.

Thanks.

Link to comment
Share on other sites

Looks like its " Profile "

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

Looks like its " Profile "

Always difficult to count spaces in these forum msgs. Looking at the source for the page, (where the periods are spaces) it was "..Profile..". So I tried "Profile", "..Profile..", ".Profile.", "Profile.." and nothing worked. Still not sure why. However the _IELinkClickByIndex() is working fine.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...