示例#1
0
        private static void unitTest()
        {
            var doc = XPathAnalyzer.GetHtmlDocument(url);

            var datas = XPathAnalyzer.GetDataFromURL(url);

            var properties = doc.DocumentNode.SearchPropertiesSmartList();


            var firstOrDefault = properties.FirstOrDefault();

            datas = doc.DocumentNode.GetDataFromXPath(firstOrDefault.CrawItems).ToList();
        }
示例#2
0
        public void XPathTest()
        {
            var doc = XPathAnalyzer.GetHtmlDocument(url);

            Assert.IsTrue(doc != null);
            var datas = XPathAnalyzer.GetDataFromURL(url);

            Assert.IsTrue(datas != null && datas.Count > 10);
            var properties = doc.DocumentNode.SearchPropertiesSmartList();

            Assert.IsTrue(properties.Any());
            var firstOrDefault = properties.FirstOrDefault();

            datas = doc.DocumentNode.GetDataFromXPath(firstOrDefault.CrawItems).ToList();
            Assert.IsTrue(datas != null && datas.Count > 10);
        }