为什么同样的链接,au3同样的两个函数,_IEACtion无效而_IELinkClickByText却有效呢
#include <IE.au3>#include <MsgBoxConstants.au3>
$oIE = _IEAttach("http://hao.360.cn/","url")
Local $lis = _IETagNameGetCollection($oIE, "li")
_IELinkClickByText($oIE, "360娱乐") ;这个有效
Local $sTxt = ""
For $li In $lis
$elem = $li.innerText
If $elem=="360娱乐" Then
MsgBox(64,"提示","执行到这里了")
Sleep(200)
_IEAction($li,"click")样;这一句无效
EndIf
$sTxt &= $elem & @CRLF
Next
MsgBox($MB_SYSTEMMODAL,"提示", $sTxt)
;_IEQuit($oIE)
#include <IE.au3>
$oIE = _IEAttach("https://hao.360.cn/", "url")
Local $lis = _IETagNameGetCollection($oIE, "a")
;_IELinkClickByText($oIE, "360娱乐") ;这个有效
Local $sTxt = ""
For $li In $lis
$elem = $li.innerText
If StringInStr($elem, "360娱乐") Then
_IEAction($li, "click")
ExitLoop
EndIf
Next 回复 2# zghwelcome
多谢你把我的代码规范了一下
但测试还是无效
测试环境 winxp X86 +IE8 win7 IE11测试正常
页:
[1]