Jump to content

Multiple IE instances?


Recommended Posts

Hello sorry to post again but i have a question. 

I have a script that works perfectly as i want and thanks to all for your help, but is there a way to open a new instance of that script? or multiple session or internet explorer? like run multiple times that script, because it dont need to have cookies of previous session of IE, no is like create a new IE with no cookie, no history, no cache, no nothing. Anyone can help me a little bit? i will try to figure it out, am here to learn as much as possible thanks in advanced to all.

Link to comment
Share on other sites

 

Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe -noframemerging")

 

 

​I created the IE but i cannot send any comand to it, this is my code so far.

#include <IE.au3>
Local $oIE = Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe -noframemerging")
Sleep(4000)
$1oIE = _IEAttach($oIE)
_IENavigate($1oIE,"youtube.com")

And i got this errors:

--> IE.au3 T3.0-1 Warning from function _IEAttach, $_IESTATUS_NoMatch
--> IE.au3 T3.0-1 Error from function _IENavigate, $_IESTATUS_InvalidDataType

Thanks in advanced to all.

Link to comment
Share on other sites

Run returns a process ID. So you have to get the handle of this IE instance and use it witch _IEAttach.

For example, you can do something like this :

#include <IE.au3>

Local $iPid = Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe -noframemerging about:blank")
Local $oIE

While 1
    $aWinList = WinList("[CLASS:IEFrame]")
    For $i = 1 To $aWinList[0][0]
        If BitAND( WinGetState($aWinList[$i][1]), 2) AND StringInStr( WinGetText($aWinList[$i][1]), "about:blank") Then
            $oIE = _IEAttach($aWinList[$i][1], "hwnd")
            ExitLoop 2
        EndIf
    Next
WEnd

_IENavigate($oIE, "youtube.com")

 

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...