Hey, so this is a function I've written today to use in something I was working on that required proxies. You just pass it the amount of pages you want it to go through(one page contains 50 proxies) and it will return you the list of proxies in IP:PORT format. Maybe it'll be useful for someone.
Code
static List<string> getProxies(int pages)
{
string p, t;
List<string> _prox = new List<string>();
WebClient wc = new WebClient() { Proxy = null };
for (int x = 0; x < pages; x++)
{
MatchCollection matches = Regex.Matches(wc.DownloadString("http://hidemyass.com/proxy-list/" + x), @"<tr class="".*?"" ?rel="".*?"">([\s\S]+?)</tr>");
foreach (Match m in matches)
{
t = m.Groups[1].Value;
p = Regex.Match(t, @"<td>\s?([0-9]{3,7})</td>").Groups[1].Value;
t = Regex.Match(t, "<td><span>(.+?)</span></td>", RegexOptions.IgnoreCase).Groups[1].Value;
t = Regex.Replace(t, @"<(span|div) style=""display:none"">.+?</(span|div)>", "");
t = Regex.Replace(t, "</?span[^>]*>", "");
t = t + ":" + p;
_prox.Add(t);
}
}
return _prox;
}
