Excel 如何读取IE在提交按钮后显示的弹出消息内容
我已经在网页中自动输入了数据,在最后一次单击提交按钮时,它会显示一个弹出窗口,其中显示生成的注册号。 我想知道是否有任何方法可以复制该注册号并将其保存在excel中。 请查看附件中的图片。 [在此处输入图像描述][1] [1]: 我并没有自动点击提交按钮,但之后如何阅读弹出窗口不知道从哪里开始,在互联网上搜索了很多,但并没有找到我要找的 请在顶部找到HTML代码,点击后会生成一个名为“保存”的按钮。Excel 如何读取IE在提交按钮后显示的弹出消息内容,excel,vba,automation,Excel,Vba,Automation,我已经在网页中自动输入了数据,在最后一次单击提交按钮时,它会显示一个弹出窗口,其中显示生成的注册号。 我想知道是否有任何方法可以复制该注册号并将其保存在excel中。 请查看附件中的图片。 [在此处输入图像描述][1] [1]: 我并没有自动点击提交按钮,但之后如何阅读弹出窗口不知道从哪里开始,在互联网上搜索了很多,但并没有找到我要找的 请在顶部找到HTML代码,点击后会生成一个名为“保存”的按钮。 Sys.WebForms.PageRequestManager.getInstance
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
函数BeginRequestHandler(发送方,args){var oControl=args.get_postBackElement();oControl.disabled=true;}
函数处置器(发送方,参数){
var elements=args.get_panelsUpdating();
对于(var i=elements.length-1;i>=0;i--){
var元素=元素[i];
var allnodes=element.getElementsByTagName('*'),
长度=allnodes.length;
变量节点=新数组(长度)
对于(var k=0;k=0;k--){
行为[k].dispose();
}
}
}
}
element.innerHTML=“”;
}
}
Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(disposeTree);
Cufon.now();
//
您可以尝试使用selenium basic并切换到alert。但不确定selenium basic是否有getText方法。这是DOM弹出窗口/浏览器弹出窗口/Windows弹出窗口吗?如果这是一个附在页面上的html弹出窗口,请在上面共享的html代码的注释中提及该元素。@dilimpeghwal我无能为力,因为我不知道html以及这些弹出窗口是如何工作的,我只是使用VBA获取网页中的数据。我不知道那是HTML的哪一部分弹出的。但是有一件事我可以说,当弹出窗口出现时,我不能在IE中做任何事情,除非我点击OK。你能使用IE开发者工具检查弹出窗口吗?没有开发者工具不能在弹出窗口上工作。弹出窗口后,你不能点击任何地方
<input type="submit" name="ctl00$ContentPlaceHolder1$btnOk" value="Ok" id="ctl00_ContentPlaceHolder1_btnOk" class="btn" style="display:none;" />
</div>
<div id="ctl00_ContentPlaceHolder1_UpdateProgress" style="display:none;">
<img id="ctl00_ContentPlaceHolder1_Image1" src="images/loader.gif" alt="Processing" style="border-width:0px;" />
</div>
</td>
</tr>
</table>
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnVosFlag" id="ctl00_ContentPlaceHolder1_hdnVosFlag" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnLNEXP_TYPE" id="ctl00_ContentPlaceHolder1_hdnLNEXP_TYPE" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnHDRLNEXP_TYPE" id="ctl00_ContentPlaceHolder1_hdnHDRLNEXP_TYPE" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnPFID" id="ctl00_ContentPlaceHolder1_hdnPFID" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnpfRefNo" id="ctl00_ContentPlaceHolder1_hdnpfRefNo" value="0" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnflagNewPan" id="ctl00_ContentPlaceHolder1_hdnflagNewPan" value="N" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hndchkpan" id="ctl00_ContentPlaceHolder1_hndchkpan" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hndIsStatusEnabled" id="ctl00_ContentPlaceHolder1_hndIsStatusEnabled" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hndRetamt" id="ctl00_ContentPlaceHolder1_hndRetamt" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hndDdlNEFTAcc" id="ctl00_ContentPlaceHolder1_hndDdlNEFTAcc" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hndUsersol" id="ctl00_ContentPlaceHolder1_hndUsersol" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hndneft" id="ctl00_ContentPlaceHolder1_hndneft" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnAttchmentID" id="ctl00_ContentPlaceHolder1_hdnAttchmentID" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnPfLvl" id="ctl00_ContentPlaceHolder1_hdnPfLvl" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnvenStatus" id="ctl00_ContentPlaceHolder1_hdnvenStatus" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$TabName" id="ctl00_ContentPlaceHolder1_TabName" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnMode" id="ctl00_ContentPlaceHolder1_hdnMode" value="I" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$venid" id="ctl00_ContentPlaceHolder1_venid" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$siteid" id="ctl00_ContentPlaceHolder1_siteid" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdncrAcc" id="ctl00_ContentPlaceHolder1_hdncrAcc" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnNEFTAcc" id="ctl00_ContentPlaceHolder1_hdnNEFTAcc" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnduedtflag" id="ctl00_ContentPlaceHolder1_hdnduedtflag" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnpfidindex" id="ctl00_ContentPlaceHolder1_hdnpfidindex" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnlstPFids" id="ctl00_ContentPlaceHolder1_hdnlstPFids" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnUserType" id="ctl00_ContentPlaceHolder1_hdnUserType" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnDOPLimit" id="ctl00_ContentPlaceHolder1_hdnDOPLimit" value="1000000" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdn_IFSC_CODE" id="ctl00_ContentPlaceHolder1_hdn_IFSC_CODE" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdn_account_id" id="ctl00_ContentPlaceHolder1_hdn_account_id" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnExpenseSolId" id="ctl00_ContentPlaceHolder1_hdnExpenseSolId" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnOrgCreationDt" id="ctl00_ContentPlaceHolder1_hdnOrgCreationDt" />
<input type="hidden" name="ctl00$ContentPlaceHolder1$hdnChkerEin" id="ctl00_ContentPlaceHolder1_hdnChkerEin" />
<script type="text/javascript" language="javascript">
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
function BeginRequestHandler(sender, args) { var oControl = args.get_postBackElement(); oControl.disabled = true; }
</script>
<script language="javascript" type="text/javascript">
function disposeTree(sender, args) {
var elements = args.get_panelsUpdating();
for (var i = elements.length - 1; i >= 0; i--) {
var element = elements[i];
var allnodes = element.getElementsByTagName('*'),
length = allnodes.length;
var nodes = new Array(length)
for (var k = 0; k < length; k++) {
nodes[k] = allnodes[k];
}
for (var j = 0, l = nodes.length; j < l; j++) {
var node = nodes[j];
if (node.nodeType === 1) {
if (node.dispose && typeof (node.dispose) === "function") {
node.dispose();
}
else if (node.control && typeof (node.control.dispose) === "function") {
node.control.dispose();
}
var behaviors = node._behaviors;
if (behaviors) {
behaviors = Array.apply(null, behaviors);
for (var k = behaviors.length - 1; k >= 0; k--) {
behaviors[k].dispose();
}
}
}
}
element.innerHTML = "";
}
}
Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(disposeTree);
</script>
</td>
</tr>
</table>
</div>
<!-- #main (end) -->
</td>
</tr>
</table>
<!-- #wrapper (end) -->
<script type="text/javascript">Cufon.now();</script>
<script type="text/javascript">
//<![CDATA[
var ctl00_mnuCRM_Data = new Object();
ctl00_mnuCRM_Data.disappearAfter = 500;
ctl00_mnuCRM_Data.horizontalOffset = 0;
ctl00_mnuCRM_Data.verticalOffset = 0;
ctl00_mnuCRM_Data.hoverClass = 'ctl00_mnuCRM_14 hover';
ctl00_mnuCRM_Data.hoverHyperLinkClass = 'ctl00_mnuCRM_13 hover';
ctl00_mnuCRM_Data.staticHoverClass = 'ctl00_mnuCRM_12 statichover';
ctl00_mnuCRM_Data.staticHoverHyperLinkClass = 'ctl00_mnuCRM_11 statichover';
theForm.oldSubmit = theForm.submit;
theForm.submit = WebForm_SaveScrollPositionSubmit;
theForm.oldOnSubmit = theForm.onsubmit;
theForm.onsubmit = WebForm_SaveScrollPositionOnSubmit;
Sys.Application.add_init(function() {
$create(Sys.Extended.UI.CalendarBehavior, {"format":"dd/MM/yyyy","id":"ctl00_ContentPlaceHolder1_TextBox1_CalendarExtender"}, null, null, $get("ctl00_ContentPlaceHolder1_txtduedt"));
});
Sys.Application.add_init(function() {
$create(Sys.Extended.UI.AutoCompleteBehavior, {"completionInterval":10,"completionListCssClass":"autocomplete_completionListElement","completionListItemCssClass":"autocomplete_listItem","completionSetCount":20,"delimiterCharacters":"","highlightedItemCssClass":"autocomplete_highlightedListItem","id":"AutoCompleteVenEx","minimumPrefixLength":2,"onHide":"{\"AnimationName\":\"Parallel\",\"Duration\":\".4\",\"AnimationChildren\":[{\"AnimationName\":\"FadeOut\",\"AnimationChildren\":[]},{\"AnimationName\":\"Length\",\"PropertyKey\":\"height\",\"StartValueScript\":\"$find(\\u0027AutoCompleteVenEx\\u0027)._height\",\"EndValue\":\"0\",\"AnimationChildren\":[]}]}","onShow":"{\"AnimationName\":\"Sequence\",\"AnimationChildren\":[{\"AnimationName\":\"OpacityAction\",\"Opacity\":\"0\",\"AnimationChildren\":[]},{\"AnimationName\":\"HideAction\",\"Visible\":\"true\",\"AnimationChildren\":[]},{\"AnimationName\":\"ScriptAction\",\"Script\":\"\\r\\n // Cache the size and setup the initial size\\r\\n var behavior = $find(\\u0027AutoCompleteVenEx\\u0027);\\r\\n if (!behavior._height) {\\r\\n var target = behavior.get_completionList();\\r\\n behavior._height = target.offsetHeight - 2;\\r\\n target.style.height = \\u00270px\\u0027;\\r\\n }\",\"AnimationChildren\":[]},{\"AnimationName\":\"Parallel\",\"Duration\":\".4\",\"AnimationChildren\":[{\"AnimationName\":\"FadeIn\",\"AnimationChildren\":[]},{\"AnimationName\":\"Length\",\"PropertyKey\":\"height\",\"StartValue\":\"0\",\"EndValueScript\":\"$find(\\u0027AutoCompleteVenEx\\u0027)._height\",\"AnimationChildren\":[]}]}]}","serviceMethod":"GetVendorList","servicePath":"/rfp/frmGSTINPaymentformTax.aspx"}, {"itemSelected":SettxtVDName_hiddenValue,"populated":HidevenImage,"populating":ShowvenImage}, null, $get("ctl00_ContentPlaceHolder1_txtVDName"));
});
Sys.Application.add_init(function() {
$create(Sys.Extended.UI.CalendarBehavior, {"format":"dd/MM/yyyy","id":"ctl00_ContentPlaceHolder1_CalendarExtender1"}, null, null, $get("ctl00_ContentPlaceHolder1_txtInvoicedt"));
});
Sys.Application.add_init(function() {
$create(Sys.Extended.UI.CalendarBehavior, {"format":"dd/MM/yyyy","id":"ctl00_ContentPlaceHolder1_CalendarExtender2"}, null, null, $get("ctl00_ContentPlaceHolder1_txtdoa"));
});
Sys.Application.add_init(function() {
$create(Sys.Extended.UI.AutoCompleteBehavior, {"completionInterval":10,"completionListCssClass":"autocomplete_completionListElement","completionListItemCssClass":"autocomplete_listItem","completionSetCount":20,"delimiterCharacters":"","highlightedItemCssClass":"autocomplete_highlightedListItem","id":"AutoCompleteEx","onHide":"{\"AnimationName\":\"Parallel\",\"Duration\":\".4\",\"AnimationChildren\":[{\"AnimationName\":\"FadeOut\",\"AnimationChildren\":[]},{\"AnimationName\":\"Length\",\"PropertyKey\":\"height\",\"StartValueScript\":\"$find(\\u0027AutoCompleteEx\\u0027)._height\",\"EndValue\":\"0\",\"AnimationChildren\":[]}]}","onShow":"{\"AnimationName\":\"Sequence\",\"AnimationChildren\":[{\"AnimationName\":\"OpacityAction\",\"Opacity\":\"0\",\"AnimationChildren\":[]},{\"AnimationName\":\"HideAction\",\"Visible\":\"true\",\"AnimationChildren\":[]},{\"AnimationName\":\"ScriptAction\",\"Script\":\"\\r\\n // Cache the size and setup the initial size\\r\\n var behavior = $find(\\u0027AutoCompleteEx\\u0027);\\r\\n if (!behavior._height) {\\r\\n var target = behavior.get_completionList();\\r\\n behavior._height = target.offsetHeight - 2;\\r\\n target.style.height = \\u00270px\\u0027;\\r\\n }\",\"AnimationChildren\":[]},{\"AnimationName\":\"Parallel\",\"Duration\":\".4\",\"AnimationChildren\":[{\"AnimationName\":\"FadeIn\",\"AnimationChildren\":[]},{\"AnimationName\":\"Length\",\"PropertyKey\":\"height\",\"StartValue\":\"0\",\"EndValueScript\":\"$find(\\u0027AutoCompleteEx\\u0027)._height\",\"AnimationChildren\":[]}]}]}","serviceMethod":"GetHSNSACList","servicePath":"/rfp/frmGSTINPaymentformTax.aspx"}, {"itemSelected":SetddlTypeValue,"populated":HidehsnImage,"populating":ShowhsnImage}, null, $get("ctl00_ContentPlaceHolder1_txtHSN_SAC"));
});
Sys.Application.add_init(function() {
$create(Sys.UI._UpdateProgress, {"associatedUpdatePanelId":"ctl00_ContentPlaceHolder1_UpdatePanel10","displayAfter":500,"dynamicLayout":true}, null, null, $get("ctl00_ContentPlaceHolder1_UpdateProgress9"));
});
Sys.Application.add_init(function() {
$create(Sys.UI._UpdateProgress, {"associatedUpdatePanelId":"ctl00_ContentPlaceHolder1_savepnlData","displayAfter":500,"dynamicLayout":true}, null, null, $get("ctl00_ContentPlaceHolder1_UpdateProgress"));
});
//]]>
</script>
</form>
</body>
</html>