Jump to content

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


Herb191
 Share

Recommended Posts

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.

Link to comment
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.

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
Link to comment
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)
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...