IE.au3 报错
$sText = _IEBodyReadText($oIE)在调用 _IEBodyReadText的时候报
D:\Program Files\autoit3\Include\IE.au3 (1964) : ==> ???????????("Object").:
Return SetError($_IEStatus_Success, 0, $o_object.document.body.innerText)
Return SetError($_IEStatus_Success, 0, $o_object.document.body^ ERROR
指到
#include <IE.au3>
里的这句
Return SetError($_IEStatus_Success, 0, $o_object.document.body.innerText)
原
Func _IEBodyReadText(ByRef $o_object)
If Not IsObj($o_object) Then
__IEErrorNotify("Error", "_IEBodyReadText", "$_IEStatus_InvalidDataType")
Return SetError($_IEStatus_InvalidDataType, 1, 0)
EndIf
If Not __IEIsObjType($o_object, "browserdom") Then
__IEErrorNotify("Error", "_IEBodyReadText", "$_IEStatus_InvalidObjectType", "Expected document element")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
;
Return SetError($_IEStatus_Success, 0, $o_object.document.body.innerText)
EndFunc ;==>_IEBodyReadText
不知道是哪里的问题? 完整代码拿出来 本帖最后由 liangxm 于 2011-12-22 13:02 编辑
Func work($address_value, $account_value, $code_value)
$address_value = GUICtrlRead($address,1)
$account_value = GUICtrlRead($account)
$code_value = GUICtrlRead($code)
$account_start = GUICtrlRead($number_start)
$account_end = GUICtrlRead($number_end)
If $account_start = $account_end Then
$url = "http://"&$address_value&"/xxxx/access?soapaction=config_gm&game_id="&$account_value&"&game_level="&$code_value
$oIE = _IECreate($url,0,0,1,-1)
$sText = _IEBodyReadText($oIE)
$ie_note = GUICtrlCreateLabel($account_value&$number& @CRLF &$address_value & @CRLF &$code_value & @CRLF &$sText, 20, 270, 460, 120)
;;$ie_note = GUICtrlCreateLabel($account_value&$number& @CRLF &$address_value & @CRLF &$code_value & @CRLF, 20, 270, 460, 120)
_IEQuit ($oIE)
Else
$mun = 0
For $number = $account_end To $account_start Step -1
$mun = $mun + 1
$url = "http://"&$address_value&"/xxxx/access?soapaction=config_gm&game_id="&$account_value&$number&"&game_level="&$code_value
$oIE = _IECreate($url,0,0,1,-1)
$sText = _IEBodyReadText($oIE)
$ie_note = GUICtrlCreateLabel($account_value&$number& @CRLF &$address_value & @CRLF &$code_value & @CRLF &$sText, 20, 270, 460, 120)
;;$ie_note = GUICtrlCreateLabel($account_value&$number& @CRLF &$address_value & @CRLF &$code_value & @CRLF , 20, 270, 460, 120)
_IEQuit ($oIE)
Next
$ie_note_start = $ie_note - $mun + 1
For $idx = $ie_note_start To $ie_note - 1
GUICtrlSetState($idx, $GUI_HIDE)
Next
EndIf
EndFunc ;==>GUIChangeItems 本帖最后由 liangxm 于 2011-12-22 13:07 编辑
不加_IEBodyReadText就没问题,而且好像有时虽然会有警告消息但也能运行。
怀疑是不是ie取回的数据有问题造成的?
ps,不会是ie8升级到ie9的问题吧- - 最后顶一顶 加个au3 /au3吧 这样看着好累所以我没看具体代码
在加载网页之后加一个等待网页加载完成之类的延时
新打开网页的时候加一个_IELoadWait($oIE)
_IEBodyReadTex之前用一个
Do
Sleep (50)
Until $oie.readyState() = 4
页:
[1]