Beispiel #1
0
        public static List <pspTerm> GetAllTerms()
        {
            var listOfTerms = new List <pspTerm>();
            var webGet      = new HtmlWeb();

            webGet.OverrideEncoding = encoding;

            var html = webGet.Load(documentRoot);

            try
            {
                var mainContent = html.DocumentNode.SelectSingleNode("//div[@id = 'main-content']");        // getting the div with content
                var tableRows   = mainContent.SelectNodes(".//tr");
                //var links = mainContent.SelectNodes(".//a[@href]");
                //foreach (var link in links)
                foreach (var row in tableRows)
                {
                    var term = new pspTerm(row, webGet);
                    listOfTerms.Add(term);
                }
                Console.WriteLine("sd");
            }
            catch (Exception)
            {
                Console.WriteLine("Error while loading " + documentRoot);
                throw;
            }

            return(listOfTerms);
        }
Beispiel #2
0
        public static List<pspTerm> GetAllTerms() { 
            var listOfTerms = new List<pspTerm>();
            var webGet = new HtmlWeb();
            webGet.OverrideEncoding = encoding;

            var html = webGet.Load(documentRoot);
            try
            {
                var mainContent = html.DocumentNode.SelectSingleNode("//div[@id = 'main-content']");        // getting the div with content
                var tableRows = mainContent.SelectNodes(".//tr");
                //var links = mainContent.SelectNodes(".//a[@href]");
                //foreach (var link in links)
                foreach (var row in tableRows)
                {
                    var term = new pspTerm(row, webGet);
                    listOfTerms.Add(term);
                    
                }
                Console.WriteLine("sd");
            }
            catch (Exception)
            {
                Console.WriteLine("Error while loading " + documentRoot);
                throw;
            }

            return listOfTerms;
        }