?????????ν???????????????????????? ?????????100 ?? ?????????100 ????????????2017???и??μ??????
?????ν????????????M????????????????????????а?????
??????????£????????????????????У???2017????μ??????????????
?????????????????????????????????????????????????????????????????????????????????μ???????????????????д???????
??????????xlsx??????????????£????????????excel????????????20????д??????excel????csv?????????1????????????excel??????csv??
??????????????????????
????????????????????????????洢?????
?????洢??????????????????????±???????Щ?????

??????????????????
????????????????????????????????????????
class Proficient
{
/// <summary>
/// ????
/// </summary>
public string Title
{
get; set;
}
/// <summary>
/// ???
/// </summary>
public string Url
{
get; set;
}
/// <summary>
/// ????????
/// </summary>
public string Date
{
get; set;
}
}
?????????????????? ???? ?? ????????????????м????????????????????????????????????????????????????????????????????????
??????????????δ???????????????????????μ?????
????????????? HtmlAgilityPack ?????????????
????HtmlAgilityPack ????????????????????????nuget??????£???????????
??????????????????????
??????????д????????? static void GetDate(Proficient proficient) ?????????
???????????? var url = proficient.Url;
???????????????????????????
?????????????????????
????HtmlWeb web = new HtmlWeb();
????HtmlDocument doc = web.Load(url);
?????????csdn????????????????????? detail_list

??????δ? HtmlAgilityPack ???????? class ??
?????????xpath????????? xpath ??????? class ??xpath ????????????????
???????? xpath ???? C#+HtmlAgilityPack+XPath??????????(?????????????????) - ??????? - ?????
????????detail_list????? ul ???? xpath????????д
????var temp = doc.DocumentNode.SelectNodes("//ul[@class='detail_list']/li");
???????е? // ??????????λ??
????ul ???????????????????????????????????????????????? class ????????????????????? /li ??·??????????????????????????????·????д??
???????????????????? detail_b ????
???????????????????????????????? class ?? detail_b
<ul class="detail_list">
<li>
<h4><a href="http://blog.csdn.net/lindexi_gd/article/details/52041944" target="_blank">win10 uwp ????</a></h4>
<p class="detail_p">UWP??????????????????????????????????UWP?????????д??????</p>
<div class="detail_b"><span>2016-07-27 08:55</span>
<div class="fa fa-eye"></div><em>2752</em>
</div>
</li>
??????????????
????temp = doc.SelectNodes("//div[@class='detail_b']");
???????????????????????????? div ????????????????
???????html????????????
??????????????????????????????????????????Щ?????????????????????????????????
??????λ?????????????
????proficient.Date = temp.Elements().FirstOrDefault().InnerText;
???????????????????????????????Щ????? ???? 9??00 ???????????
????????????????д???????д??????????????????
private static void Write(List<Proficient> proficient)
{
string file = "E:\???????\csdn????100.csv";
using (StreamWriter stream=new StreamWriter(new FileStream(file??FileMode.Create)??Encoding.GetEncoding("gbk")))
{
foreach (var temp in proficient)
{
stream.WriteLine(temp.Title+"??"+temp.Url+"??"+temp.Date+"??"+temp.Folpv+"??"+temp.Num);
}
}
}
?????????????
?????????????????????????ж?????μ???????????????????????
????????????д??????????£????????csdn???????????????……??????ν???????????