title: How do i click on a website button?
body: <p>I'm navigating in the constructor first for testing</p>
  
  <pre><code>webBrowser1.ScriptErrorsSuppressed = true;
  webBrowser1.Navigate("http://www.tapuz.co.il/forums/forumpage/393");
  webBrowser1.DocumentCompleted += webBrowser1_DocumentCompleted;
  </code></pre>
  
  <p>Then in the DocumentCompleted event:</p>
  
  <pre><code>void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
              {
  
                  HtmlElementCollection items = this.webBrowser1.Document.GetElementsByTagName("span"); 
                  foreach (HtmlElement item in items)
                  {
                      if (item.GetAttribute("className") == "addMessage")
                      {
                          webBrowser1.Document.GetElementById("onclick").InvokeMember("click");
                      }
                  }
              }
  </code></pre>
  
  <p>When i make inspect element on the addMessage button i see:</p>
  
  <pre><code>&lt;span class="addMessage" onclick="location='http://www.tapuz.co.il/forums/addmsg/393/טבע_ומזג_אוויר/מזג_האוויר'"&gt;  | הוספת הודעה&lt;/span&gt;
  </code></pre>
  
  <p>But i'm getting null on the line:</p>
  
  <pre><code>webBrowser1.Document.GetElementById("onclick").InvokeMember("click");
  </code></pre>
  
  <p>What i want to do is to click on the addMessage button.</p>