【发布时间】:2016-04-26 19:34:27
【问题描述】:
尝试编写一个按钮单击亚马逊网站上的按钮,如下所示:
<span class="action-go" onclick="MYO.JS.handle_action($(this).parent().find('.action option:selected').attr('value'), $(this).parent().find('.action option:selected').attr('url'));">
<input width="21" height="21" align="absmiddle" type="image" src="https://images-na.ssl-images-amazon.com/images/G/01/abis-ui/buttons/go._V187564664_.gif" border="0">
</span>
<input width="21" height="21" align="absmiddle" type="image" src="https://images-na.ssl-images-amazon.com/images/G/01/abis-ui/buttons/go._V187564664_.gif" border="0">
这是我尝试过的:
Func GetButtons()
Local $oBtns = _IETagNameGetCollection($g_oIE, "span")
For $oBtn In $oBtns
If String($oBtn.classname) = "action-go" Then
_IEAction($oBtn, "click")
EndIf
ExitLoop
Next
EndFunc
有效的解决方案
Func ClickButton()
$HWND = _IEPropertyGet($g_oIE, 'HWnd')
WinSetState($HWND, "", @SW_MAXIMIZE)
_IEAction($g_oIE,"visible")
_IELoadWait($g_oIE)
MouseClick($MOUSE_CLICK_LEFT, 290, 354, 2)
EndFunc ;==>GetButtons
【问题讨论】:
标签: javascript internet-explorer onclick autoit