我用c#在webbrowser中加载一个页面,当用户输入关键字点击搜索后,url还是一样,页面内容

我用c#在webbrowser中加载一个页面,当用户输入关键字点击搜索后,url还是一样,页面内容变了,我现在每次都是获取第一次加载,怎么取到搜索之后的html?该怎么写?最好有源码!谢谢

 WebBrowser web = new WebBrowser();
            //webBrowser1.Navigate(url);
           // web.Url = new Uri(url);
            web.Navigate(url);
            //等待网页加载
            while (web.ReadyState < WebBrowserReadyState.Complete) Application.DoEvents();
            HtmlDocument htmldoc = web.Document;
           for (int i = 1; i <=10; i++)
           {
               HtmlElement html = htmldoc.GetElementById(i.ToString());
               HtmlElementCollection c = html.GetElementsByTagName("a");
               string a=c[0].GetAttribute("href");
               string s = c[0].InnerText;
              // MessageBox.Show(c[0].InnerHtml+s);
               UrlAnText.Add(a, s);
           }

温馨提示:答案为网友推荐,仅供参考
相似回答