I have written an application which loads a website and invokes a click event on certain buttons.
Im using the WPF WebBrowser control and attaching to the LoadCompleted event.
var Document = this.MyBrowser.Document as mshtml.HTMLDocument;
var InputTags = Document.getElementsByTagName("INPUT");
foreach (HtmlElement tag in InputTags)
{
if (tag.Name == "commit" && tag.GetAttribute("value") == "Activate")
{
tag.InvokeMember("Click");
}
}
This code works perfectly fine on most pages, however it seems the WebBrowser control is not a fully compliant browser and does not render all websites correctly.
On one site im just getting a few images and a grey background. Looking at the source it hasnt loaded most of the page.
The page renders fine in Chrome, Firefox and IE.
Any other browsers i can use that will give me the same functionality that im using in my code example above?
The user agent of the control is reported as:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/7.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; Tablet PC 2.0; Zoom 3.6.0; wbx 1.0.0)
This was marked as a duplicate. Upgrading the browser to use IE11 emulation didnt resolve the issue.