我使用webbrowser控件导航到一个按钮的按钮,当按下按钮时会出现弹出窗口,我必须在弹出窗口中执行某些操作,然后我必须关闭它并返回浏览器。 我尝试用NewWindow事件来做这个,但是我无法使它工作
foreach (System.Windows.Forms.HtmlElement html in webBrowser.Document.GetElementsByTagName("a"))
{
if (html.InnerText == "Like")
{
html.InvokeMember("click"); // here i press the button and the pop-up appear
// Here I must make some actions in the pop-up(I must press other button)
// and here I must close the popup and to continue in the first page
}
}