Exemplo n.º 1
0
        public void CheckValidity()
        {
            _doc = Scraping.GetPage(Link);

            var cNameNode   = _doc.DocumentNode.SelectSingleNode("//p[@class='novel_subtitle']");
            var chapterName = (cNameNode == null) ? string.Empty : cNameNode.InnerText.TrimStart().TrimEnd();
            var cIdNode     = _doc.DocumentNode.SelectSingleNode("//div[@id='novel_no']");
            var chapterId   = (cIdNode == null) ? string.Empty : cIdNode.InnerText.TrimStart().TrimEnd();

            if (string.IsNullOrEmpty(chapterName) || string.IsNullOrEmpty(chapterId))
            {
                return;
            }

            if (chapterName != Name)
            {
                return;
            }

            chapterId = chapterId.Substring(0, chapterId.IndexOf("/"));

            if (Convert.ToInt32(chapterId) != Id)
            {
                return;
            }

            Valid = true;
        }
Exemplo n.º 2
0
 public Main()
 {
     //InitializeComponent();
     //var end
     Scraping.CrawlAsync();
     //var msg = end ? "Download Complete" : "Operation Failed";
     //MessageBox.Show(msg);
     Close();
 }