/// <summary> /// Fetches content for the specified URL and analyze it. /// </summary> /// <returns><see cref="PageData"></see> object</returns> /// <remarks> /// <p> /// This method fetches content from the specified URL and then analyzes it to put /// data into respective components like <see cref="HeaderData"></see>, <see cref="LinkDataCollection"></see> etc. /// inside <see cref="PageData"></see> object. /// </p> /// </remarks> public PageData AnalyzePage() { PageExtractor obPageExtractor = new PageExtractor(this); PageData obPageData = obPageExtractor.GetPageData(); return(obPageData); }
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()); }
static void Main(string[] args) { db = new PageInfoContext(); pExtractor = new PageExtractor(); // Create a Timer object that knows to call our TimerCallback // method once every 2000 milliseconds. Timer t = new Timer(TimerCallback, null, 0, 10000); // Wait for the user to hit <Enter> Console.ReadLine(); }
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()); }
public DZoneProxy() { fetcher = new PageFetcher(); extractor = new PageExtractor(); }