コード例 #1
0
        /// <summary>
        /// Begins the scrape. Returns an HTML Node from a URL.
        /// </summary>
        /// <returns>The scrape.</returns>
        /// <param name="name">Name.</param>
        public List <HtmlNode> BeginScrape(string name)
        {
            SpecialNameFormatting specialFormatInit = new SpecialNameFormatting();
            WebClient             webClient         = new WebClient();

            string page = webClient.DownloadString(specialFormatInit.splitNameGetURL(name));

            HtmlDocument doc = new HtmlDocument();

            doc.LoadHtml(page);

            try
            {
                List <HtmlNode> x = doc.GetElementbyId(Globals.tableClass).Elements(Globals.tableClassElement).ToList();
                Globals.isMissing = false;
                return(x);
            }

            catch (NullReferenceException error)
            {
                errorHandle(error);
                Globals.isMissing = true;
                return(null);
            }
        }