Jump to content

IE Quit needed tabs


Recommended Posts

Hi,

Can't resolve a problem with killing needed attached tabs, always is killed 3 from 5.

Here is 6 links, 5 need to be killed:

#include <IE.au3>
#include <String.au3>
$oIE = _IECreate('facebook.com')
__IENavigate($oIE, 'm.facebook.com', 0, 0x800)
__IENavigate($oIE, 'm.facebook.com', 0, 0x800)
__IENavigate($oIE, 'm.facebook.com', 0, 0x800)
__IENavigate($oIE, 'm.facebook.com', 0, 0x800)
__IENavigate($oIE, 'm.facebook.com', 0, 0x800)
sleep(5000)
Dim $aIE[1]
Dim $aRE[1]
$aIE[0] = 0
$aRE[0] = 0
$i = 1
While 1
    $oIE = _IEAttach ("", "instance", $i)
    If @error = $_IEStatus_NoMatch Then ExitLoop
    ReDim $aIE[$i + 1]
    ReDim $aRE[$i + 1]
$aIE[$i] = $oIE
$get = _IEPropertyGet($oIE, "locationurl")
$aRE[$i] = $get
    $aIE[0] = $i
$check = _StringBetween($get, "m.", ".com")
If not @error then
  $oIE = _IEAttach ("", "instance", $i)
  ConsoleWrite('Get = '&$get&@CRLF)
  _IEQuit($oIE)
  sleep(200)
EndIf
    $i += 1
WEnd
MsgBox(0, "Browsers Found", "Number of browser instances in the array: " & $aIE[0])

Thank you in advance.

Tedy.

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
Share on other sites

I have find solution:

#include <IE.au3>
#include <String.au3>
#include <Array.au3>
$oIE = _IECreate('facebook.com')
__IENavigate($oIE, 'm.facebook.com', 0, 0x800)
__IENavigate($oIE, 'm.facebook.com', 0, 0x800)
__IENavigate($oIE, 'm.facebook.com', 0, 0x800)
__IENavigate($oIE, 'm.facebook.com', 0, 0x800)
__IENavigate($oIE, 'm.facebook.com', 0, 0x800)
sleep(5000)
Dim $aIE[1], $cLinks[1]
$aIE[0] = 0
$i = 1
While 1
    $oIE = _IEAttach ("", "instance", $i)
    If @error = $_IEStatus_NoMatch Then ExitLoop
    ReDim $aIE[$i + 1], $cLinks[$i + 1]
    $aIE[$i] = $oIE
    $aIE[0] = $i
    ConsoleWrite($oIE.LocationURL&@CRLF)
$check = _StringBetween($oIE.LocationURL, "m.", ".com")
if not @error then $cLinks[$i] = $i
    $i += 1
WEnd
;_ArrayDisplay($cLinks)
;_ArraySort($cLinks,1,2,$i)
;_ArrayDisplay($cLinks)
For $cLink In $cLinks
$check = Number($cLink)
If not ($check = 0) then
  $oIE = _IEAttach ("", "instance", $check)
  _IEQuit($oIE)
EndIf
Next

Tedy.

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

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

×
×
  • Create New...