_IENavigate 返回错误 -1 并将 @error 标志设置为 0,但根据 AutoIt 文档,@error 永远不应为 0
_IENavigate returning error -1 and setting @error flag to 0 but @error should never be 0 according to AutoIt docs
我有一个 AutoIt 脚本,可以转到一个网站、登录并导航到另一个页面。但是 _IENavigate 抛出 the documentation 中没有的错误。以下代码的输出是:"Here is what the flag is: -1 and the error flag is: 0"
但是您会在文档中看到只有错误代码 1-9 存在,@error = 0 没有标志...
我确实注意到浏览器确实导航到第二页,但是当我尝试获取页面上的所有标签时,它找不到它们。请帮忙! :)
Local $oIE = _IE
Create("http://www.example.com/")
_IELoadWait($oIE)
Local $j_username = _IEGetObjByName($oIE, "username")
_IEFormElementSetValue($j_username, $sUser)
Local $j_password = _IEGetObjByName($oIE, "password")
_IEFormElementSetValue($j_password, $sPass)
Local $login_submit = _IEGetObjByName($oIE, "button")
_IEAction($login_submit, "click")
_IELoadWait($oIE)
$iFlag = _IENavigate($oIE, "http://www.example.com/page2", 1)
ConsoleWrite( "Here is what the flag is: " & $iFlag & " and the error flag is: " & @error & @CRLF)
_IELoadWait($oIE)
原来文档说:
This function always returns a value of -1. This is because the navigate method has no useful return value and therefore nothing can be implied from it.
这是一项功能,而不是错误。 :)
我有一个 AutoIt 脚本,可以转到一个网站、登录并导航到另一个页面。但是 _IENavigate 抛出 the documentation 中没有的错误。以下代码的输出是:"Here is what the flag is: -1 and the error flag is: 0"
但是您会在文档中看到只有错误代码 1-9 存在,@error = 0 没有标志...
我确实注意到浏览器确实导航到第二页,但是当我尝试获取页面上的所有标签时,它找不到它们。请帮忙! :)
Local $oIE = _IE
Create("http://www.example.com/")
_IELoadWait($oIE)
Local $j_username = _IEGetObjByName($oIE, "username")
_IEFormElementSetValue($j_username, $sUser)
Local $j_password = _IEGetObjByName($oIE, "password")
_IEFormElementSetValue($j_password, $sPass)
Local $login_submit = _IEGetObjByName($oIE, "button")
_IEAction($login_submit, "click")
_IELoadWait($oIE)
$iFlag = _IENavigate($oIE, "http://www.example.com/page2", 1)
ConsoleWrite( "Here is what the flag is: " & $iFlag & " and the error flag is: " & @error & @CRLF)
_IELoadWait($oIE)
原来文档说:
This function always returns a value of -1. This is because the navigate method has no useful return value and therefore nothing can be implied from it.
这是一项功能,而不是错误。 :)