Skip to content

Instantly share code, notes, and snippets.

@andrewpisula
Created June 18, 2018 14:16
Show Gist options
  • Save andrewpisula/6d71b121276fe4ac082aa3ea8a6aef56 to your computer and use it in GitHub Desktop.
Save andrewpisula/6d71b121276fe4ac082aa3ea8a6aef56 to your computer and use it in GitHub Desktop.
A Proxy Scraper created by mysterious.
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
*/
@elkizza
Copy link

elkizza commented Jun 24, 2018

cool ok
lol
thanks dad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment