private void button6_Click(object sender, EventArgs e) { WebBrowser reee = new WebBrowser(); reee.Navigate("http://site.com"); MessageBox.Show(reee.DocumentText);//вернёт пустоту } 

You need to wait until the page loads, and make MessageBox.Show(reee.DocumentText) .

PS BROWSER OUTSIDE THE METHOD CAN NOT BE ANNOUNCED!

    1 answer 1

    Set the DocumentCompleted event handler using the lambda function.

     WebBrowser reee = new WebBrowser(); reee.DocumentCompleted += (s1, e1) => MessageBox.Show(reee.DocumentText); reee.Navigate("http://site.com");