Created
February 23, 2021 16:15
-
-
Save saasindustries/f30a52820bf71085f411e2b0665ec417 to your computer and use it in GitHub Desktop.
This file contains 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
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