Internet explorer VBS确认IE弹出窗口

Internet explorer VBS确认IE弹出窗口,internet-explorer,vbscript,popup,Internet Explorer,Vbscript,Popup,我有下一个HTML代码: <input type="submit" name="ctl00$MainContent$btn_update" value="Update" onclick="return confirm('You are about to update the data. Are you sure?');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$MainContent$b

我有下一个HTML代码:

<input type="submit" name="ctl00$MainContent$btn_update" value="Update" onclick="return confirm('You are about to update the data. Are you sure?');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$MainContent$btn_update&quot;, &quot;&quot;, true, &quot;Update_PL&quot;, &quot;&quot;, false, false))" id="ctl00_MainContent_btn_update" class="normalButton" style="float: right; margin-right: 108px; margin-top: -3px; width: 130px; height: 50px; font-size: 24px;">
但我不知道怎么做,只需单击下面显示的“确定”按钮:

我尝试了下一个:

  • 使用objShell.SendKeys“{ENTER}”
  • 激活IE弹出窗口并使用SendKeys

    AppActivate(“来自网页的消息”)

    objShell.SendKeys“{ENTER}”

  • 使用Windows任务管理器-应用程序上显示的名称激活IE弹出窗口。但这里的问题是IE Web窗口和IE弹出窗口在Windows任务管理器中具有相同的名称,因此AppActivate不知道要激活哪个窗口

  • **使用sendkeys,我尝试了sendkeys“{ENTER}”和sendkeys“%K”,但没有成功的结果

    VBS代码的有趣部分是:

    For Each a In .document.getElementsByTagName("a")
                    If InStr(a.GetAttribute("href"), linkToDetail)<> 0 And Not IsNull((InStr(a.GetAttribute("href"), linkToDetail))) Then
                        a.Click()
                        WaitWebLoad()
                        .document.getElementByID(editButton).Click()
                        WaitWebLoad()
                        .document.getElementByID(editArrivalDateTB).Value = activeSheet.Cells(rowIndex, columnArrivalDate).Value
                        .document.getElementByID(updateArrivalDateButton).Click()
    
                        'Something to press the OK button of the IE dialog window.
    
                        objShell.AppActivate(Window Title "- Internet Explorer")
    
                        WaitWebLoad()
                        objIE.document.getElementByID(backToSearchPL).Click()
                        WaitWebLoad()
                        Exit For
                    End If
                Next
    
    对于.document.getElementsByTagName(“a”)中的每个a
    如果InStr(a.GetAttribute(“href”)、linkToDetail)0且不为null((InStr(a.GetAttribute(“href”)、linkToDetail)),则
    a、 单击()
    WaitWebLoad()
    .document.getElementByID(编辑按钮)。单击()
    WaitWebLoad()
    .document.getElementByID(editArrivalDateTB).Value=activeSheet.Cells(rowIndex,columnArrivalDate).Value
    .document.getElementByID(updateArrivalDateButton)。单击()
    '要按IE对话框窗口的“确定”按钮的内容。
    AppActivate(窗口标题“-InternetExplorer”)
    WaitWebLoad()
    objIE.document.getElementByID(backToSearchPL)。单击()
    WaitWebLoad()
    退出
    如果结束
    下一个
    
    完成

    由于我不能点击OK按钮,我已经删除了弹出式上升的代码

    objIE.document.getElementById("nameOfTheButton").onclick = ""
    objIe.document.getElementById("nameOfTheButton").Click()
    
    objIE.document.getElementById("nameOfTheButton").onclick = ""
    objIe.document.getElementById("nameOfTheButton").Click()