日期:2014-05-17 浏览次数:21059 次
public Form1()
{
InitializeComponent();
string url = "http://www.xxxx.cc/";
webBrowser1.Navigate(url);
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
for (int i = 1; i < 8; i++)
{
string[] args = { "AspNetPager1", i.ToString() };
webBrowser1.Document.InvokeScript("__doPostBack", args);
if (webBrowser1.IsBusy == false && webBrowser1.StatusText == "完成")
{
string body = webBrowser1.Document.Body.OuterHtml;
string exp = " 共([\\s\\S]*?)页,当前为第([\\s\\S]*?)页,每页10条";
Match match = Regex.Match(body, exp, RegexOptions.IgnoreCase);
string num = match.Groups[2].Value.ToString();
}
}
}