Recently a project needs to use the past weather data, I found the weather after the site (www.tianqihoubao.com), and in the SS completed the relevant collection, and share with you.
The first analysis of this site provides two types of information:
1. Provincial and municipal relations
2. Weather Records
Corresponding to our create data structure:
[Serializable]
public class province
{public
string provincename;
public string Provinceurl;
}
[Serializable]
public class city
{public
province province;
public string CityName;
public string Cityurl;
}
[Serializable]
public class Weatherdataset
{public City
;
public string Title;
public string Url;
[Serializable]
public class Weatherdata
{public
weatherdataset DataSet;
public string Date;
public string Textweather;
public string Temp;
public string Wind;
}
>> website provides 34 municipalities/provinces/SAR weather information, complete list in: http://www.tianqihoubao.com/lishi/index.htm
The corresponding acquisition statements are:
var list = Default.selectnodes ("#content DT a");
>> Each province has a list of cities under its jurisdiction, such as: http://www.tianqihoubao.com/lishi/hebei.htm