我不知道用来点击按钮的元素。你知道吗
我试着这样写:
driver.find_element_by_xpath('//*/input[@type="button"]').click()
错误消息:
raise exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementNotVisibleException: Message: element not visible
HTML格式:
<input type="button" name="ctl00$c3$g_6_f947_400a_aa18_59efd84584ae$ctl00$toolBarTbl$RightRptControls$ctl00$ctl00$diidIOSaveItem" value="Save" onclick="if (!PreSaveItem()) return false;if (SPClientForms.ClientFormManager.SubmitClientForm('WPQ2')) return false;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ctl33$g_69_f947_400a_aa18_59efd84584ae$ctl00$toolBarTbl$RightRptControls$ctl00$ctl00$diidIOSaveItem", "", true, "", "", false, true))" id="ctl00_ctl33_g_696_f947_400a_aa18_59efd84584ae_ct0_toolBarTbl_RightRptControls_ctl00_ctl00_diidIOSaveItem" accesskey="O" class="ms-ButtonHeightWidth" target="_self">
不知道为什么要使用
//*/input
而不是直接使用//input
。这是解决办法。你知道吗你试过寻找价值吗?你知道吗
如果这不工作,这将是有益的,如果你可以上传网页的HTML你正在测试或提供的网址。你知道吗
“保存”字是否可见?如果是这样,你可以试试这个:
相关问题 更多 >
编程相关推荐