public int NicovideoParsing() { var articles = HTMLDoc.DocumentNode .SelectNodes(@"//p[@class=""itemTitle""]/a") .Select(a => new { Url = a.Attributes["href"].Value.Trim(), Title = a.Attributes["title"].Value.Trim(), }); // Nicoの構造を見てParsingする Console.WriteLine("全{0}記事", articles.Count()); foreach (var a in articles) { Console.WriteLine(a.Title); Console.WriteLine(" {0}{1}", RootURL[0], a.Url); MovieData Data = new MovieData(); Data.SetTitle(a.Title); Data.SetUrl(RootURL[0] + a.Url); Datas.SetData(Data); } return 0; }
public void SetData(MovieData Data) { this.Datas.Add(Data); }