[英]AutoIt Clicking a onClick Javascript button with no name or id only class in IE
Trying to script a button click on a button on the amazon website that looks like this: 尝试编写一个脚本脚本,然后单击亚马逊网站上的一个按钮,如下所示:
<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">
This is what I have tried: 这是我尝试过的:
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
Solution that Worked 有效的解决方案
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
I don't have the time to script you a solution, but i can tell you how I would do it. 我没有时间为您编写解决方案的脚本,但是我可以告诉您我将如何做。 The trick is to not click on the button, but its position.
诀窍是不要单击按钮,而是单击其位置。 This only works if the GUI allways has the same proportionalities.
仅当GUI始终具有相同的比例时,这才有效。
You can click on a position by useing MouseClick . 您可以使用MouseClick单击某个职位。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.