private List <XPathTest> XPathDataTest(String xPathWorker) { try { var testList = new List <XPathTest>(); var htmlNodes = _htmlDoc.DocumentNode.SelectNodes(xPathWorker); if (htmlNodes != null) { foreach (var x in htmlNodes) { var newVacancy = new XPathTest { InnerText = x.InnerText.Replace(" ", " ").Trim() }; testList.Add(newVacancy); } } return(testList); } catch (NullReferenceException) { LogRtbAppendText("Exception!" + "\r\n"); return(new List <XPathTest>()); } }
private List <XPathTest> XPathAttributeTest(String xPathWorker, String attribute) { try { var testList = new List <XPathTest>(); var htmlNodes = _htmlDoc.DocumentNode.SelectNodes(xPathWorker); if (htmlNodes != null) { foreach (var x in htmlNodes) { var newVacancy = new XPathTest { Attribute = x.Attributes[attribute].Value }; testList.Add(newVacancy); } } return(testList); } catch (NullReferenceException) { LogRtbAppendText("Exception!" + "\r\n"); return(new List <XPathTest>()); } }