Beispiel #1
0
        public void SetInfoFromSections(HtmlNodeCollection sections)
        {
            var wordsToCheck = new string[0];
            //copy
            var sectionsClone = sections.ToList();

            //position
            wordsToCheck = new string[] { "біографія" };
            for (int i = 0; i < sectionsClone.Count; i++)
            {
                var label = LecturerPageCriteria.GetLowerLabelFromSection(sectionsClone[i]);

                if (Contains(label, wordsToCheck))
                {
                    Biography = LecturerPageCriteria.GetInnerTextFromDivInSection(sectionsClone[i]);
                    sectionsClone.RemoveAt(i);
                    break;
                }
            }
            //academic rank
            wordsToCheck = new string[] { "наукові інтереси" };
            for (int i = 0; i < sectionsClone.Count; i++)
            {
                var label = LecturerPageCriteria.GetLowerLabelFromSection(sectionsClone[i]);

                if (Contains(label, wordsToCheck))
                {
                    ScientificInterests = LecturerPageCriteria.GetInnerTextFromDivInSection(sectionsClone[i]);
                    sectionsClone.RemoveAt(i);
                    break;
                }
            }
            //
        }
Beispiel #2
0
        public void SetInfoFromRows(HtmlNodeCollection infoRows)
        {
            var wordsToCheck = new string[0];
            //copy
            var infoRowsClone = infoRows.ToList();

            //position
            wordsToCheck = new string[] { "посада" };
            for (int i = 0; i < infoRowsClone.Count; i++)
            {
                var label = LecturerPageCriteria.GetLowerLabelFromRow(infoRowsClone[i]);

                if (Contains(label, wordsToCheck))
                {
                    this.Position = LecturerPageCriteria.GetValueInnerTextFromRow(infoRowsClone[i]);
                    infoRowsClone.RemoveAt(i);
                    break;
                }
            }
            //academic rank
            wordsToCheck = new string[] { "звання" };
            for (int i = 0; i < infoRowsClone.Count; i++)
            {
                var label = LecturerPageCriteria.GetLowerLabelFromRow(infoRowsClone[i]);

                if (Contains(label, wordsToCheck))
                {
                    this.AcademicRank = LecturerPageCriteria.GetValueInnerTextFromRow(infoRowsClone[i]);
                    infoRowsClone.RemoveAt(i);
                    break;
                }
            }
            //contacts
            wordsToCheck  = new string[] { "профіль", "пошта" };
            this.Contacts = "";
            for (int i = 0; i < infoRowsClone.Count; i++)
            {
                var label = LecturerPageCriteria.GetLowerLabelFromRow(infoRowsClone[i]);

                if (Contains(label, wordsToCheck))
                {
                    var contact = LecturerPageCriteria.GetValueLinkFromRow(infoRowsClone[i]);
                    this.Contacts = string.Concat(Contacts, " ", contact);
                    infoRowsClone.RemoveAt(i);
                }
            }

            //

            //

            //
        }
Beispiel #3
0
 public void SetName(HtmlNode lecturerPage)
 {
     Name = LecturerPageCriteria.GetLecturerName(lecturerPage);
 }