Created
June 18, 2018 14:16
-
-
Save andrewpisula/6d71b121276fe4ac082aa3ea8a6aef56 to your computer and use it in GitHub Desktop.
A Proxy Scraper created by mysterious.
This file contains hidden or 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
using System; | |
using System.Net; | |
using System.Text.RegularExpressions; | |
namespace Proxy_Scraper | |
{ | |
class Engine | |
{ | |
public static string ScrapeProxies() | |
{ | |
string ProxyList = string.Empty; | |
WebClient Client = new WebClient(); | |
string scrapedHtml = Client.DownloadString("https://free-proxy-list.net/#list"); | |
foreach (Match match in new Regex(@"<td>([0-9]*).([0-9]*).([0-9]*).([0-9]*)<\/td><td>([0-9]*)</").Matches(scrapedHtml)) | |
{ | |
string matchValue = match.Value; | |
if (!matchValue.Contains("-") && matchValue.Contains(".")) | |
{ | |
matchValue = matchValue.Replace("</td><td>", ":"); | |
matchValue = matchValue.Replace("</", string.Empty); | |
matchValue = matchValue.Replace("<td>", string.Empty); | |
string Proxy = matchValue + "\r\n"; | |
if (!ProxyList.Contains(Proxy)) | |
{ | |
ProxyList += Proxy; | |
} | |
} | |
} | |
scrapedHtml = Client.DownloadString("https://www.sslproxies.org/"); | |
foreach (Match match in new Regex(@"<td>([0-9]*).([0-9]*).([0-9]*).([0-9]*)<\/td><td>([0-9]*)</").Matches(scrapedHtml)) | |
{ | |
string matchValue = match.Value; | |
if (!matchValue.Contains("-") && matchValue.Contains(".")) | |
{ | |
matchValue = matchValue.Replace("</td><td>", ":"); | |
matchValue = matchValue.Replace("</", string.Empty); | |
matchValue = matchValue.Replace("<td>", string.Empty); | |
string Proxy = matchValue + "\r\n"; | |
if (!ProxyList.Contains(Proxy)) | |
{ | |
ProxyList += Proxy; | |
} | |
} | |
} | |
scrapedHtml = Client.DownloadString("https://www.us-proxy.org/"); | |
foreach (Match match in new Regex(@"<td>([0-9]*).([0-9]*).([0-9]*).([0-9]*)<\/td><td>([0-9]*)</").Matches(scrapedHtml)) | |
{ | |
string matchValue = match.Value; | |
if (!matchValue.Contains("-") && matchValue.Contains(".")) | |
{ | |
matchValue = matchValue.Replace("</td><td>", ":"); | |
matchValue = matchValue.Replace("</", string.Empty); | |
matchValue = matchValue.Replace("<td>", string.Empty); | |
string Proxy = matchValue + "\r\n"; | |
if (!ProxyList.Contains(Proxy)) | |
{ | |
ProxyList += Proxy; | |
} | |
} | |
} | |
scrapedHtml = new WebClient().DownloadString("http://www.idcloak.com/proxylist/free-proxy-servers-list.html"); | |
foreach (Match match in new Regex(@"d>([0-9]*)</td><td>([0-9]*).([0-9]*).([0-9]*).([0-9]*)<").Matches(scrapedHtml)) | |
{ | |
string matchValue = match.Value; | |
matchValue = matchValue.Replace("</td><td", string.Empty); | |
matchValue = matchValue.Replace("d>", string.Empty); | |
matchValue = matchValue.Replace("<", string.Empty); | |
string[] ProxySplit = matchValue.Split('>'); | |
string Proxy = ProxySplit[1] + ":" + ProxySplit[0] + "\r\n"; | |
if (!ProxyList.Contains(Proxy)) | |
{ | |
ProxyList += Proxy; | |
} | |
} | |
ProxyList += "my-proxy\r\n"; | |
scrapedHtml = Client.DownloadString("https://www.my-proxy.com/free-anonymous-proxy.html"); | |
foreach (Match match in new Regex(@">([0-9]*).([0-9]*).([0-9]*).([0-9]*):([0-9]*)<br").Matches(scrapedHtml)) | |
{ | |
string matchValue = match.Value; | |
matchValue = matchValue.Replace(">", string.Empty); | |
matchValue = matchValue.Replace("<br", string.Empty); | |
string Proxy = matchValue + "\r\n"; | |
if (!ProxyList.Contains(Proxy)) | |
{ | |
ProxyList += Proxy; | |
} | |
} | |
scrapedHtml = Client.DownloadString("https://www.my-proxy.com/free-elite-proxy.html"); | |
foreach (Match match in new Regex(@">([0-9]*).([0-9]*).([0-9]*).([0-9]*):([0-9]*)<br").Matches(scrapedHtml)) | |
{ | |
string matchValue = match.Value; | |
matchValue = matchValue.Replace(">", string.Empty); | |
matchValue = matchValue.Replace("<br", string.Empty); | |
string Proxy = matchValue + "\r\n"; | |
if (!ProxyList.Contains(Proxy)) | |
{ | |
ProxyList += Proxy; | |
} | |
} | |
scrapedHtml = Client.DownloadString("https://www.my-proxy.com/free-transparent-proxy.html"); | |
foreach (Match match in new Regex(@">([0-9]*).([0-9]*).([0-9]*).([0-9]*):([0-9]*)<br").Matches(scrapedHtml)) | |
{ | |
string matchValue = match.Value; | |
matchValue = matchValue.Replace(">", string.Empty); | |
matchValue = matchValue.Replace("<br", string.Empty); | |
string Proxy = matchValue + "\r\n"; | |
if (!ProxyList.Contains(Proxy)) | |
{ | |
ProxyList += Proxy; | |
} | |
} | |
return ProxyList; | |
} | |
} | |
} | |
/* | |
My discord is: | |
ζ͜͡๖ۣmysteriou็็็็็็็็็็s็็็็ss#4579 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cool ok
lol
thanks dad