I found the answer for this question.What I had to know is
in the following code:
public partial class Form1 : Form
{
bool finished=false;
public Form1()
{
InitializeComponent();
this.WindowState=FormWindowState.Maximized;
webBrowser1.ScriptErrorsSuppressed=true;
this.Show();
Wait4Load();
string aaa = webBrowser1.DocumentText;
}
void webBrowser1_DocumentCompleted(objectsender,WebBrowserDocumentCompletedEventArgs e)
{
if (webBrowser1.ReadyState == WebBrowserReadyState.Complete)
{
finished = true;
button1.PerformClick();
}
}
void Wait4Load()
{
webBrowser1.DocumentCompleted+=new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
button1.Click+=new EventHandler(button1_Click);
if(!finished)
{
Application.DoEvents();
Thread.Sleep(2000);
}
finished = false;
}
void button1_Click(object sender, EventArgs e)
{
//footerWrapper
while(webBrowser1.ReadyState != WebBrowserReadyState.Complete)
Application.DoEvents();
while(webBrowser1.IsBusy)
Application.DoEvents();
webBrowser1.Navigate("javascript:setTimeout(location.hash='#footerWrapper',2000)");
//Thread.Sleep(3000);
finished=true;
}
}`