如何使用C#和mshtml在IE中单击自定义创建的按钮

时间:2019-03-05 10:21:58

标签: c# html mshtml

我有以下按钮:

<button tile="Print" class="MBarChild Mbtn MBtnBase" id="print" data-test- 
ui="print"/>

以及我的C#代码中的以下方法:

foreach (SHDocVw.InternetExplorer ie in shellWindows)
        {
            if (ie.LocationURL.Contains("/icontent_e/"))
            {
                var  c = ((mshtml.HTMLDocumentClass)ie.Document).getElementById("print");

                ((mshtml.HTMLButtonElementClass)c).click();

            }
        }

将不会按下该按钮。 我的问题在哪里?

0 个答案:

没有答案
相关问题