代码如下
private void GetWeather()
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://weather.news.qq.com/inc/dc189.htm");
request.Method = "Get";
request.ContentType = "application/x-www-form-urlencoded";
WebResponse response = request.GetResponse();
Stream s = response.GetResponseStream();
StreamReader sr = new StreamReader(s,System.Text.Encoding.GetEncoding("GB2312"));
string html = sr.ReadToEnd();
s.Close();
sr.Close();
Response.Write(html.Replace("/images/","http://weather.news.qq.com/images/"));
}
比较简单,没有做什么处理,只是替换了图片的地址。
呵呵,大家可以根据自己的需求再进行处理,达到自己想要的格式