public override List <Manga> ReadHtml() { List <Manga> lMangas = new List <Manga>(); string sResult = CrawlSite(); HtmlDocument oDoc = new HtmlDocument(); oDoc.LoadHtml(sResult); if (oDoc.ParseErrors != null && oDoc.ParseErrors.Count() > 0) { } else if (oDoc.DocumentNode != null) { HtmlNodeCollection lNodes = oDoc.DocumentNode.SelectNodes("//li[div[@class='cover' or @class='intro']]"); if (lNodes != null) { foreach (HtmlNode oNode in lNodes) { Manga oManga = new Manga(); foreach (HtmlNode oDivNode in oNode.SelectNodes("div")) { if (oDivNode.Attributes.Any(x => x.Value.Equals("cover"))) { GetMangaLink(oManga, oDivNode); GetCoverLink(oManga, oDivNode); } else if (oDivNode.Attributes.Any(x => x.Value.Equals("intro"))) { GetTitle(oManga, oDivNode); GetMangaLink(oManga, oDivNode); GetChapter(oManga, oDivNode); GetChapterLink(oManga, oDivNode); GetDescription(oManga, oDivNode); } } oManga.FormatChapter(); lMangas.Add(oManga); } } } return(lMangas); }
public override List<Manga> ReadHtml() { List<Manga> lMangas = new List<Manga>(); string sResult = CrawlSite(); HtmlDocument oDoc = new HtmlDocument(); oDoc.LoadHtml(sResult); if (oDoc.ParseErrors != null && oDoc.ParseErrors.Count() > 0) { } else if (oDoc.DocumentNode != null) { HtmlNodeCollection lNodes = oDoc.DocumentNode.SelectNodes("//li[div[@class='cover' or @class='intro']]"); if (lNodes != null) foreach (HtmlNode oNode in lNodes) { Manga oManga = new Manga(); foreach (HtmlNode oDivNode in oNode.SelectNodes("div")) if (oDivNode.Attributes.Any(x => x.Value.Equals("cover"))) { GetMangaLink(oManga, oDivNode); GetCoverLink(oManga, oDivNode); } else if (oDivNode.Attributes.Any(x => x.Value.Equals("intro"))) { GetTitle(oManga, oDivNode); GetMangaLink(oManga, oDivNode); GetChapter(oManga, oDivNode); GetChapterLink(oManga, oDivNode); GetDescription(oManga, oDivNode); } oManga.FormatChapter(); lMangas.Add(oManga); } } return lMangas; }