이전 날짜 처리 추가
This commit is contained in:
1
Form1.Designer.cs
generated
1
Form1.Designer.cs
generated
@@ -59,6 +59,7 @@
|
|||||||
this.lvList.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.lvList.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.lvList.FullRowSelect = true;
|
this.lvList.FullRowSelect = true;
|
||||||
this.lvList.GridLines = true;
|
this.lvList.GridLines = true;
|
||||||
|
this.lvList.HideSelection = false;
|
||||||
this.lvList.Location = new System.Drawing.Point(0, 0);
|
this.lvList.Location = new System.Drawing.Point(0, 0);
|
||||||
this.lvList.MultiSelect = false;
|
this.lvList.MultiSelect = false;
|
||||||
this.lvList.Name = "lvList";
|
this.lvList.Name = "lvList";
|
||||||
|
|||||||
14
Form1.cs
14
Form1.cs
@@ -72,6 +72,14 @@ namespace NewsCrawler
|
|||||||
string strTime = item.SelectSingleNode(".//span").InnerText;
|
string strTime = item.SelectSingleNode(".//span").InnerText;
|
||||||
string strURL = strServerURL+item.SelectSingleNode(".//a").GetAttributeValue("href", "");
|
string strURL = strServerURL+item.SelectSingleNode(".//a").GetAttributeValue("href", "");
|
||||||
|
|
||||||
|
|
||||||
|
if (Regex.IsMatch(strTime, @"\d+/\d+") == true)
|
||||||
|
{
|
||||||
|
//Console.WriteLine("어제 기사 : " + item.InnerHtml);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (m_ItemList.Any(c => c.m_strURL==strURL)==false)
|
if (m_ItemList.Any(c => c.m_strURL==strURL)==false)
|
||||||
{
|
{
|
||||||
NEWS_ITEM news = new NEWS_ITEM();
|
NEWS_ITEM news = new NEWS_ITEM();
|
||||||
@@ -119,6 +127,12 @@ namespace NewsCrawler
|
|||||||
string strURL = item.SelectSingleNode(".//a").GetAttributeValue("href", "");
|
string strURL = item.SelectSingleNode(".//a").GetAttributeValue("href", "");
|
||||||
strURL = "http://www.etoday.co.kr/news/section/newsview.php?idxno="+Regex.Replace(strURL, @"\D", "");
|
strURL = "http://www.etoday.co.kr/news/section/newsview.php?idxno="+Regex.Replace(strURL, @"\D", "");
|
||||||
|
|
||||||
|
if (Regex.IsMatch(strTime, @"\d+/\d+") == true)
|
||||||
|
{
|
||||||
|
//Console.WriteLine("어제 기사 : " + item.InnerHtml);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_ItemList.Any(c => c.m_strURL==strURL)==false)
|
if (m_ItemList.Any(c => c.m_strURL==strURL)==false)
|
||||||
{
|
{
|
||||||
NEWS_ITEM news = new NEWS_ITEM();
|
NEWS_ITEM news = new NEWS_ITEM();
|
||||||
|
|||||||
Reference in New Issue
Block a user