I encoded a very small website in C # using the default WebBrowser control. In fact, almost everything works the way it should work, but I seem to have problems with the last step of my automation.
The website was created using several frames. This is not very important, as I just access these frames and their elements with
webBrowser1.Document.Window.Frames[0].Document.GetElementById("element").InvokeMember("click");
However, it does not work when the IFRAME source is hosted in a different domain than the actual website. When I searched the Internet for an answer to my problem, I stumbled upon an MSDN article that mentioned this particular problem and they referred to security measures against cross-site scripting that might be causing this error.
I could not find a way to disable this feature, so I switched and decided to recode everything to work with geckofx-12 instead of the standard (IE-based) web browser, but I ran into similar problems ..
My question is: Is there a way around this annoying behavior? I donβt care about security issues or whether geckofx or the default web browser control is used, I would just like to programmatically access the elements of the site that is hosted in another domain, without using the UnauthorizedAccessException.
I would like advice from a guru.
source
share