在我的表单中,我试图通过名称获取按钮。但它不返回任何值
<td class="_51m- uiOverlayFooterButtons _51mw">
<button value="1" class="_42ft _42fu layerConfirm autofocus uiOverlayButton selected _42g- _42gy" name="__CONFIRM__" type="submit" tabindex="0">Okay
</button>
<button value="1" class="_42ft _42fu layerConfirm uiOverlayButton _42gy" name="__CANCEL__" id="u_0_0" type="submit">Cancel</button>
</td>
我的代码是
HtmlElement dialogForm = dialogPage.getElementById("form");
HtmlElement dialogSubmitButton = dialogForm.getElementsByTagName("button").get(1);
当我尝试使用名称时它返回值它返回 null
HtmlElement dialogSubmitButton = dialogForm.getInputsByName("__CONFIRM__")
我如何按名称访问元素?