Exemplo n.º 1
0
        private WebPageParserResult FindTimetablesLinks(string html)
        {
            MatchCollection matches = Regex.Matches(html, TimetableUriPattern);

            var result = new WebPageParserResult
            {
                Count = matches.Count
            };

            var hyperlinks = new List <HyperlinkInfo>();

            foreach (Match match in matches)
            {
                string link  = match.Groups[GroupLink].Value;
                string title = match.Groups[GroupNumber].Value;

                hyperlinks.Add(new HyperlinkInfo
                {
                    Link  = link,
                    Title = title
                });
            }

            result.Links = hyperlinks;
            return(result);
        }
Exemplo n.º 2
0
        public WebPageParserResult GetLinksOfTimetables()
        {
            string html = GetHtmlOfTimetable();
            WebPageParserResult result = FindTimetablesLinks(html);

            return(result);
        }