Jump to content
AlienStar

Internet explorer doesn't run well in _IECreate with loop

Recommended Posts

Posted (edited)

hello everybody 

In some random positions when I'm using _IEcreate with loop, internet explorer runs then close immediately without doing the required actions 

if the loop range $i=0 to 1000, maybe the script doing at most 950 action 

all what I need is to make internet explorer runs well and doing all actions in loop 

NOTE: this problem occurs whatever the action loop is.

please help me 

Edited by AlienStar

Share this post


Link to post
Share on other sites
Posted (edited)
11 hours ago, Exit said:

Show us your script

here is 

#include <IE.au3>
#include <array.au3>
#Include <File.au3>
#include <MsgBoxConstants.au3>
#include <InetConstants.au3>
;--------------------------------------------
$inifl = "data.ini"
$inifl_arr = IniReadSectionNames($inifl)
;--------------------------------------------
for $i = UBound($inifl_arr)-1 to 1 Step -1
   
   Local $file_0 =  IniReadSection($inifl,$i)
   Local $file = $file_0[1][1]
   Local $url = $file_0[2][1]
   ;--------------------------------------------
   Local $oIE =_IECreate($url)
   ;--------------------------------------------
   _IELoadWait($oIE)
   ;--------------------------------------------
   Local $title = _IEGetObjById($oIE, "title")
   Local $oText = _IEGetObjById($oIE, "content")
   Local $oSubmit = _IEGetObjById($oIE,"publish")
   ;--------------------------------------------
   Local $ttlcntnt = FileReadLine($file, 1)
   Local $content = FileRead($file)
   ;--------------------------------------------
   _IEFormElementSetValue($title, $ttlcntnt)
   _IEFormElementSetValue($oText, $content)
   ;--------------------------------------------
   _IEAction($oSubmit, "click")
   ;------------------------------------------------
   _IELoadWait($oIE)
   ;------------------------------------------------
   ;_IEQuit($oIE)
   ProcessClose("iexplore.exe")
   ;------------------------------------------------
Next

 

Edited by AlienStar

Share this post


Link to post
Share on other sites
8 hours ago, Exit said:

Change ";_IEQuit($oIE)" to " _IEQuit($oIE)".  Aka decomment it. Otherwise you have a lot of orphan objects consuming memory.

thanks my friend but if I close internet explorer process each loop, is it right ?

ProcessClose("iexplore.exe")

 

Share this post


Link to post
Share on other sites
3 minutes ago, Exit said:

do not use processclose.

Use_ iecreate only on the first time.

Later use _ienavigate

I've used _ienavigate before but it caused high memory usage for iexplorer.exe 

Share this post


Link to post
Share on other sites

When you close IE it does a bunch of stuff to "clean" itself up, which then makes new instances fail to create. Put error handling and retry loops around _iecreate.  our use _ienavigate.


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
On 5/12/2019 at 2:24 AM, Exit said:

Change ";_IEQuit($oIE)" to " _IEQuit($oIE)".  Aka decomment it. Otherwise you have a lot of orphan objects consuming memory.

I think it's fixed by this way :) thanks so much 

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

×
×
  • Create New...