Last active
February 23, 2021 22:43
-
-
Save vainolo/1d487a1deacf4c8262e146b5cba60831 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Scrape() | |
{ | |
var scraper = new HtmlWeb(); | |
var page = scraper.Load("https://vainolo.z14.web.core.windows.net/WebScraping.html"); | |
var nodes = page.DocumentNode.Descendants().SkipWhile(e => e.Id != "Techniques").Skip(1).TakeWhile(e => e.Name != "h2"); | |
foreach (var currNode in nodes) | |
{ | |
if(currNode.GetClasses().Contains("mw-headline")) | |
{ | |
var headline = currNode.InnerText; | |
Console.WriteLine(headline); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment