Posted By

icinNet on 07/06/12


Tagged

parse ip grab Ports proxy c# proxies hidemyass


Versions (?)

HideMyAss Proxy Grabber


 / Published in: C#
 

URL: http://soft2050.in

A small snippet to parse out proxies from http://hidemyass.com/proxy-list/

  1. public static string[] grabProxy(string source)
  2. {
  3. // Credits: Soft2050
  4. var proxies = new List<string>();
  5. foreach (Match m in Regex.Matches(source, @"<td><span>([\s\S]*?)(\d+)</td>"))
  6. {
  7. string port = m.Groups[2].Value;
  8. string ip = m.Groups[1].Value;
  9. ip = Regex.Replace(ip, @"(<(div|span) style=""display:none"">\d+.*?>|<.*?>)", "").Trim();
  10. proxies.Add(string.Concat(ip, ":", port));
  11. }
  12. return proxies.ToArray();
  13. }

Report this snippet  

You need to login to post a comment.