kevin42036

_IELinkClickByText with IE11 not working

3 posts in this topic

Hi all, I am very new to Autoit and scripting in general and have a quick question. I found out about _IELinkClickByText and tried including it in my script but nothing happens. I tried running an example that somebody else posted and still, nothing happens. Only the browser opens up. Does anybody have any ideas? I am using IE11 if that makes any difference. Any input is appreciated!
 

#include <IE.au3>

$delay = 0
$wait = 5000


$sURL = "http://www.autoitscript.com/forum/index.php?"
$oIE = _IECreate($sURL, 0, 0, 0)
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_MAXIMIZE)
_IEAction($oIE, "visible")
_IELoadWait($oIE, $delay, $wait)


_IELinkClickByText($oIE, "General Help and Support")

The following code will only bring me to the URL suggested but does not click on the "General Help and Support" link

Thanks!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hello Kevin,

Tried out your code as you've posted it and it also doesn't work for me.

I got a hunch that the Text entered into the _IELinkClickByText might have to be complete or perhaps there is a duplicate on the page somewhere and the function isn't resolving to any of them. 

So I ran this to see what the full text for the link is:

$oIE = _IECreate ("http://www.autoitscript.com/forum/index.php?")
$sText = _IEBodyReadText ($oIE)
ConsoleWrite($sText)

And it appeared to be this : "AutoIt General Help and Support"

Adding Autoit in front of the text seems to make it work. Here is the working code with the change in it:

#include <IE.au3>

$delay = 0
$wait = 5000

$sURL = "http://www.autoitscript.com/forum/index.php?"
$oIE = _IECreate($sURL, 0, 0, 0)
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_MAXIMIZE)
_IEAction($oIE, "visible")
_IELoadWait($oIE, $delay, $wait)

_IELinkClickByText($oIE, "AutoIt General Help and Support")

 

Edit: Fixed spacing

Edited by BananaFish
1 person likes this

Share this post


Link to post
Share on other sites

@BananaFish That's my finding as well.

Share this post


Link to post
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