I am creating a wpf application where I use a webbrowser control. in any case, I sometimes have to look for html elements, call clicks and other basic functions.
In winbrowser web browser control, I can achieve this by doing:
webBrowser1.Document.GetElementById("someId").SetAttribute("value", "I change the value");
In the wpf control of the web browser, I managed to achieve the same:
dynamic d = webBrowser1.Document;
var el = d.GetElementById("someId").SetAttribute("value", "I change the value");
I also managed to trigger a click in the wpf web control using the dynamic type. Sometimes I get exceptions.
How can I search for html elements , set attributes and trigger clicks in a wpf web control without using dynamic types, where do I often get exceptions? I want to replace the webbrowser winforms control in a wpf application using the wpf web browser control.
source
share