Пример #1
0
        private HtmlNode handleTitleText(HtmlAgilityPack.HtmlDocument doc)
        {
            HtmlNode titleTable = null;

            for (int i = 0; i < title_text.Length; i++)
            {
                if (doc.GetElementbyId(title_text[i]) != null)
                {
                    titleTable = doc.GetElementbyId(title_text[i]).ParentNode;
                    while (titleTable.Name != "table")
                    {
                        titleTable = titleTable.NextSibling;
                    }
                    break;
                }
            }

            if (titleTable == null)
            {
                FindPage fp = new FindPage(url);
                fp.StartPosition = FormStartPosition.CenterParent;
                fp.Owner         = this;
                if (fp.ShowDialog() == DialogResult.OK)
                {
                    titleTable     = fp.titleNode;
                    animeName.Text = fp.title;
                }
            }

            return(titleTable);
        }
Пример #2
0
        private void setPage_Click(object sender, EventArgs e)
        {
            FindPage fp = new FindPage(((AnimeTitle)Owner).url);

            fp.StartPosition = FormStartPosition.CenterParent;
            fp.Owner         = this;
            if (fp.ShowDialog() == DialogResult.OK)
            {
                orig_doc = fp.newdoc;
                doc.LoadHtml(fp.newdoc.DocumentNode.OuterHtml.Replace("\n", ""));
                initForm(doc);
            }
        }