How to click on multiple links on multiple pages in webBrowser
<p>Iam Unable to do this from past one week. I want to click on multiple links n multiple web pages using webBrowser in C# Following is the code please help me in this regard.</p>

<pre><code>public void DoDelete()
{
    int count = 0;

    if (corruptList.Count &gt; 0)
    {
        foreach (string listItem in corruptList)
        {
            var th = new Thread(() =&gt;
            {
                try
                {
                    WebBrowser webBrowser = new WebBrowser();
                    webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBroswer_DocumentCompleted);
                    webBrowser.Navigate(listItem);
                    Thread.Sleep(100);
                    webBrowser.Dispose();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                this.Invoke(new MethodInvoker(delegate
                {
                    dataGridView_CorruptLinks.Rows[count].Cells[2].Value = "Deleted";
                }));
            });
            th.SetApartmentState(ApartmentState.STA);
            th.Start();
            Thread.Sleep(100);
        }
        count++;
    }
}


void webBroswer_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
    try
    {
        WebBrowser webBrowser = sender as WebBrowser;
        HtmlElementCollection ec = webBrowser.Document.GetElementsByTagName("a");
        foreach (HtmlElement item in ec)
        {
            if (item.InnerHtml == "Delete this invalid field")
            {
                item.InvokeMember("Click");
                break;
            }
        }
    }
    catch (Exception exp)
    {
    }
}
</code></pre>
