Webbrowse Navigate(url)

Discussion in 'Programming' started by mustaineoz, Sep 1, 2010.

  1. #1
    Hi,

    I'm currently working on a new project (C# and VB) and having problems with the HtmlElement collection. When I use webbrowse.Navigate(url) method, webbrowse.Document.GetElementsbyTagName("input") returns null (even though webbrowser visits the url) when I visit 2nd time. But when I visit first time, everything is fine. The problem is when I visit 2. time with Navigate method, collection is empty.

    I wonder if there are another methods to visit a link other than Navigate(url) method?
     
    mustaineoz, Sep 1, 2010 IP
  2. dpsubi1

    dpsubi1 Notable Member

    Messages:
    9,318
    Likes Received:
    420
    Best Answers:
    0
    Trophy Points:
    280
    #2
    are you waiting till the url is loaded completely ? If you are not waiting then it may return null. set breakpoint on webbrowse.Document.GetElementsb ... and see whether document is loaded then check
     
    dpsubi1, Sep 1, 2010 IP
  3. mustaineoz

    mustaineoz Active Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #3
    yes i am waiting untill the document is complately loaded by web_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles webBrowse.DocumentCompleted
     
    mustaineoz, Sep 1, 2010 IP