Ejemplo n.º 1
0
        private static void ParseThreadPosts(IHtmlDocument doc, Thread thread)
        {
            var threadDivTableHolder = doc.QuerySelector("#thread");

            foreach (var threadTable in threadDivTableHolder.QuerySelectorAll("table.post"))
            {
                if (string.IsNullOrEmpty(threadTable.Id.Replace("post", "")))
                {
                    continue;
                }
                thread.Posts.Add(PostHandler.ParsePost(doc, threadTable));
            }
        }
Ejemplo n.º 2
0
        public static List <Post> ParsePreviousPosts(IHtmlDocument doc)
        {
            var posts = new List <Post>();
            var threadDivTableHolder = doc.QuerySelector("#thread");

            foreach (var threadTable in threadDivTableHolder.QuerySelectorAll("table"))
            {
                if (string.IsNullOrEmpty(threadTable.GetAttribute("data-idx")))
                {
                    continue;
                }
                posts.Add(PostHandler.ParsePost(doc, threadTable));
            }
            return(posts);
        }