foreach(HTMLElement he in webBrowser.getElementByTagName("img"))
{
if(he.getAttribute("id").Contains("img"))
he.InvokeMember("click");
while(webBrowser.IsBusy)
Application.DoEvents;
}
this is code section in which I have problem. in first iteration htmlelement is invoked and corresponding page is loaded successfully but on invoking of second element it gives the following error:
System.UnauthorizedAccessException: 'Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))'
(Each element in loop is link to other page)
User contributions licensed under CC BY-SA 3.0