你太有才了~楼主~~
我建议用EXCEL来做,超级简单的~C#的话比较繁琐!~~
SUB CC()
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
http = "http://baidu.com"
ie.Navigate URL:=http
Do Until ie.ReadyState = 4 And Not ie.Busy
Loop
temp = ie.document.body.innerText
Do Until InStr(temp, "百度")= 0
Do Until ie.ReadyState = 4 And Not ie.Busy
Loop
temp = ie.document.body.innerText
Loop
MSGBOX TEMP
END SUB
c# 2.0 可以使用WebClient
public string GetHtmlAsUrl(string url)
{
wc = new WebClient();
string html = "Error";
try
{
byte[] b = wc.DownloadData(url);
html = System.Text.Encoding.Default.GetString(b);
}
catch (Exception ex)
{
html = ex.Message;
}
return html;
}
string aa=http://www.baidu.com/abc.htm";
string htmlContent = GetHtmlAsUrl(aa);
网页源码?
你应该建立一个http连接,get内容到一个变量中