[C#] 纯文本查看 复制代码 ubody = textBox1.Text.Trim();
HttpHelper http = new HttpHelper();
for (i = 1; i <= 10; i++)
{
HttpItem item = new HttpItem()
{
URL = "https://www.baidu.com/s?wd=" + textBox1.Text.Trim() + "&pn=" + i + "0",
Method = "GET"
};
HttpResult result = http.GetHtml(item);
string rlist = @"decoration:none\S*</a>";
MatchCollection mc = Regex.Matches(result.Html, rlist);
foreach (Match m in mc)
{
string u1 = "http://" + m.ToString().Replace("decoration:none", "").Replace(" ", "").Replace("</a>", "").Replace("\"", "").Replace(";>", "").Replace("</b>", "").Replace("<b>", "");
u1 = HttpHelper.GetBetweenHtml(u1, "http://", "/");
textBox2.AppendText("http://" + u1 + "\r\n");
}
}
|