Esempio n. 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);
            }
        }
Esempio n. 2
0
        partial void clickedScheduleButton(NSObject sender)         //Creates and grabs the appropriate URL for the selected faculty
        {
            try
            {
                string facName = htmlScheduleCombo.TitleOfSelectedItem;                    //Grabs the selected combo list item
                webViewSchedule.MainFrameUrl = specialFormatInit.splitNameGetURL(facName); //Sets browser view to the formatted URL
            }

                        #pragma warning disable CS0168
            catch (NullReferenceException error)
                        #pragma warning restore CS0168
            {
                errorMessage();
            }
        }