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);
}
温馨提示:答案为网友推荐,仅供参考