how do I access navigate to url via hyperlink using HTMLDocument? RRS feed

  • Question

  • I have used the code below to access a page with frames and then to access links within the frames. There is one link in particular that I want to navigate to without the user clicking it. I can't simply use webBrowser.navigate(url); I get redirected back to the main page with frames. Is it possible to use the HTMLDocument DOM to programmatically click the link and access the page?


    string linkNeeded = null;

    HtmlWindow currentWindow=myWebBrowser3.Document.Window;

    foreach (HtmlWindow frame in currentWindow.Frames)


    finalFrame = frame.Url.ToString();



    //label2.Text = frameCount.ToString();


    foreach (HtmlElement linkElem in frame.Document.Links)




    linkNeeded = frameLinksHash.ContainsKey("");






    Tuesday, June 5, 2007 5:46 PM