-1
wb.Document.GetElementById("RandomIframe").Children[1].contentWindow.document.children[0].children[1].children[11].children[7].children[0].children[1].click();

Error message

'HtmlElement' does not contain a definition for 'contentWindow' and no extension method 'contentWindow' accepting a first argument of type 'HtmlElement' could be found (are you missing a using directive or an assembly reference?)

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
ЯАR
  • 21
  • 1
  • 2

1 Answers1

0

here is js code that could work:

```

function invokeClick(){ document.GetElementById("RandomIframe").contentWindow.document.GetElementById("yourclickabledom").click(); }

``` place js code to you web page, or implement a c# string to wrap those code, then inject code to your html by this post: How to inject Javascript in WebBrowser control?

then follow this post to invoke it: How to call javascript inside a WebBrowser control in winforms?

make sure your html page is completely loaded with webbrowser event: https://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.documentcompleted(v=vs.110).aspx

Dongdong
  • 2,208
  • 19
  • 28