Skip to content

Instantly share code, notes, and snippets.

@vainolo

vainolo/Method2.cs

Last active May 6, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.