Skip to content

Instantly share code, notes, and snippets.

@saasindustries
Created February 23, 2021 16:15
Show Gist options
  • Save saasindustries/f30a52820bf71085f411e2b0665ec417 to your computer and use it in GitHub Desktop.
Save saasindustries/f30a52820bf71085f411e2b0665ec417 to your computer and use it in GitHub Desktop.
static List<string> GetAdLinks(string url){
var mainPageAdLinks = new List<string>();
var html = GetHtml(url);
var links = html.CssSelect("a");
foreach (var link in links){
if(link.Attributes["href"].Value.Contains(".html")){
mainPageAdLinks.Add(link.Attributes["href"].Value);
}
}
return mainPageAdLinks;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment