protected override void ParseImpl() { try { var root = HtmlPage.FindElements("table").Last() .FindFirst("td").FindFirst("ul"); GetPageCount(HtmlPage.FindFirst("body").FindElements("center").ElementAt(1)); S1ListItem item = null; foreach (var e in root.Descendants("li")) { item = S1ListItem.GetItem(e); var replys = reply_pattern.Match(e.Element("span").InnerHtml); if (replys.Success) { item.Subtle = replys.Value; } theData.Add(item); } } catch (System.Exception) { } finally { if (theData.Count == 0) { S1Parser.User.ErrorParser.Parse(HtmlPage); throw new InvalidDataException(); } } }
protected override void ParseImpl() { try { var root = HtmlPage.FindElements("table").Last().FindFirst("td"); S1ListItem lastitem = null; foreach (var e in root.Descendants()) { if (e.Name == "li") { var header = e.Element(); if (header.Name == "h2") { lastitem = new S1ListItem { Title = header.InnerHtml }; theData.Add(lastitem); } else { //missing ul AddChildItem(lastitem, e); } } else { AddChildren(lastitem, e); } } } catch (System.Exception) { } finally { if (theData.Count == 0) { S1Parser.User.ErrorParser.Parse(HtmlPage); throw new InvalidDataException(); } } }