Sign in to follow this  
Followers 0
Herb191

Click on a link in IE and keep new browser window invisible?

5 posts in this topic

I need something similar to _IELinkClickByText. I can’t use _IECreate to go the URL because I want to track the link analytics on the website.

Share this post


Link to post
Share on other sites



You can keep the IE window hidden by setting the _IECreate $f_visible parameter to '0'. You should also be able to click link by text or index while it is hidden. If you need more help, you need to be more detailed in what the issue is. Maybe post a snippet of your script.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You can keep the IE window hidden by setting the _IECreate $f_visible parameter to '0'. You should also be able to click link by text or index while it is hidden. If you need more help, you need to be more detailed in what the issue is. Maybe post a snippet of your script.

As I said in my first post I can't use _IECreate.

And here is some example code.

#include <IE.au3>
 
$oIE = _IECreate("http://google.com/", 0, 0)
$oBody = _IETagNameGetCollection($oIE, "body", 0)
 
_IEDocInsertHTML($oBody, '<a href="http://yahoo.com/" target="_blank">Test link</a><br />', "afterbegin")
 
;I need something other than _IELinkClickByText so I can click on the link and the new window is not visible
_IELinkClickByText($oIE, "Test link", 0, 0)
 
_IEQuit($oIE)
Edited by Herb191

Share this post


Link to post
Share on other sites

ah, missed that in the first post. I'm not really that experienced with auto it nor exactly sure what your trying to achieve, but maybe you can try click link by index.

Share this post


Link to post
Share on other sites

Well it's by far not the best solution but I found a work around. I had to set IE's default setting to always open windows in a new tab. Then I used this code:

#include <IE.au3>
 
$oIE = _IECreate("http://google.com/", 0, 0)
$oBody = _IETagNameGetCollection($oIE, "body", 0)
 
_IEDocInsertHTML($oBody, '<a href="http://yahoo.com/" target="_blank">Test link</a><br />', "afterbegin")
 
WinMove("Google - Windows Internet Explorer", "", -1000, -1000)
 
;_IELinkClickByText will work now because you can't see the window when it clicks a new link
_IELinkClickByText($oIE, "Test link", 0, 1)
 
$oIE2 = _IEAttach("http://yahoo.com/", "url")
 
Sleep(5000)
_IEQuit($oIE2)
_IEQuit($oIE)

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
Sign in to follow this  
Followers 0