예제 #1
0
        public void ExtractLinks_Should_Succeed()
        {
            var extractor = new PageExtractor();
            var pageInfo  = extractor.Extract("<link href=\"https:\\\\website.com\"");

            Assert.AreEqual(1, pageInfo.links.Count());
            Assert.AreEqual("https:\\\\website.com", pageInfo.links.First());
        }
예제 #2
0
        public void ExtractContent_Should_AsExpected()
        {
            var extractor = new PageExtractor();
            var pageInfo  = extractor.Extract(@"
<html>
    <head>
        <style></style>
    </head>
    <body>
        <div>Something</div>
        <script>var abc = function()</script>
    </body>
</html>
");

            Assert.AreEqual("Something", pageInfo.content.Trim());
        }