C# NullReferenceException on GetElementById HtmlElement
<p>this is inside my sample.html</p>

<pre><code>&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;Test&lt;/title&gt;    
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div id="testingID"&gt;hello&lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>and i have this code in c# that i want to prompt is the world "hello" inside the <strong><em>div</em></strong> element with the id <strong>testingID</strong></p>

<pre><code>private void btnGetData_Click(object sender, EventArgs e)
    {
        string url = string.Format("{0}/sample.html", Environment.CurrentDirectory);
        WebBrowser webb = new WebBrowser();

        webb.Navigate(url);

        var doc = webb.Document;
        HtmlElement elem = doc.GetElementById("testingID");
        MessageBox.Show(elem.InnerText);
    }
</code></pre>

<p>but i get <em>Object reference not set to an instance of an object.</em> on <em>MessageBox.Show(elem.InnerText);</em></p>

<p>a little help here.. </p>
