我正在使用C#,赢取应用,尝试点击我的webbrowser上的iframe中的按钮.
HTML:
<iframe frameborder="0" scrolling="no" id="EditorIFrmae" name="EditorIFrmae" width="100%" height="700" style="z-index: 0; height: 852px;" src="X"></iframe>
Run Code Online (Sandbox Code Playgroud)
在iframe代码中:
<div height="" width="100%" style="position: relative; min-height: 50px;" onclick="javascript:funcEditPage('SB_Content_Page','SB_Content_PagePreview','PAGE5.asp');" class="SB_DivContentPreview" id="SB_Content_PagePreview">
</div>
Run Code Online (Sandbox Code Playgroud)
我的代码:
HtmlElementCollection linkit = this.webBrowser1.Document.GetElementsByTagName("div");
foreach (HtmlElement foundit in linkit)
{
if (foundit.GetAttribute("id").Equals("SB_Content_PagePreview"))
{
foundit.InvokeMember("Click");
}
}
Run Code Online (Sandbox Code Playgroud)
我怎么能点击按钮?
我想向"<div> </div>"我的 webBrowser 页面添加一个。
http://google.com例如,我导航到div该页面,并且想在该页面上添加我自己的页面,有没有办法做到这一点?