|
本帖最后由 newester 于 2009-6-27 00:00 编辑
我的脚本运行之后,它 ( _IECreate 创建的iexplore.exe ) 占用的内存为什么越来越大呢 ? 我运行一段时间后,内存占用竟然达到500多M,而且还在随着时间增长而增加,晕,谁告诉我,谢谢了。
(功能是自动下载Discuz论坛某版块某些页面的用户头像 )脚本内容如下:
#include <IE.au3>
$oIE = _IECreate ("www.baidu.com",0,1)
For $num = 1 to 100
;___________________________________________________________________
_IENavigate ($oIE,"http://www.discuz.net/forum-73-"&$num&".html")
$sHTML = _IEBodyReadHTML ($oIE)
$xArray = StringSplit($sHTML,'space.php?uid=',1)
For $i = 0 to UBound($xArray)-1
If $i < 2 Then ContinueLoop
$sID = StringLeft($xArray[$i],(StringInStr($xArray[$i], '"')-1))
_IENavigate ($oIE, "http://www.discuz.net/space.php?uid="&$sID)
;---------------------------------------------------------------------------
$sHTML = _IEBodyReadHTML ($oIE)
if ( StringInStr($sHTML, "您所在的用户组(Guest)无法进行此操作")>0 ) then
$oForm = _IEFormGetObjByName ($oIE, "login")
$oTexta = _IEFormElementGetObjByName ($oForm, "username")
_IEFormElementSetValue ($oTexta, "登陆用户名")
$oTextb = _IEFormElementGetObjByName ($oForm, "password")
_IEFormElementSetValue ($oTextb, "登陆密码")
_IEFormElementCheckboxSelect ($oForm, "2592000", "cookietime", 1, "byValue")
$o_login = _IEFormElementGetObjByName ($oForm, "loginsubmit")
_IEAction ($o_login, "click")
sleep(2000)
_IENavigate ($oIE, "http://www.discuz.net/space.php?uid="&$sID)
$sHTML = _IEBodyReadHTML ($oIE)
endif
;-----------------------------------------------------------------------------------------------
if ( StringInStr($sHTML, "data/avatar")>0 ) then
$tmp = StringSplit($sHTML,'http://www.discuz.net/uc_server/data/',1)
;MsgBox(0, "Array[2] :", UBound($tmp)&"_______________"&$tmp[2])
$sIMG = StringLeft($tmp[2],(StringInStr($tmp[2], '<ul id=profile_act>')-1))
$tmp = StringSplit($sIMG,'">',1)
$sIMG = $tmp[1]
;MsgBox(0, "Src:", $sIMG)
$tmp=StringSplit($sIMG,'/',1)
$sName=$tmp[5]
;MsgBox(0, "Name:", $sName)
If FileExists(@ScriptDir&"\"&$sName) Then
Else
InetGet("http://www.discuz.net/uc_server/data/"&$sIMG,@ScriptDir&"\"&$sName)
EndIf
endif
Next
;___________________________________________________________________
Next |
|