public void GetMetaNodesCollection_ValidHtml_ReturnHtmlNodeCollection() { var htmlDocument = HtmlAgilityPackHelper.RetrieveHtml(ValidUrl); var nodeCollection = HtmlAgilityPackHelper.GetMetaNodesCollection(htmlDocument); Assert.IsNotNull(nodeCollection); }
public void GetMetaNodesCollection_InvalidHtml_ReturnNull() { var htmlDocument = new HtmlDocument(); var nodeCollection = HtmlAgilityPackHelper.GetMetaNodesCollection(htmlDocument); Assert.IsNull(nodeCollection); }
private List <string> GetKeywordsFromUrl(string url) { if (!IsUrlValid(url)) { return(null); } var htmlDocument = HtmlAgilityPackHelper.RetrieveHtml(url); var metaNodes = HtmlAgilityPackHelper.GetMetaNodesCollection(htmlDocument); return(GetKeywordsFromMetaNodes(metaNodes)); }