Skip to content

Commit

Permalink
[update] 云代理
Browse files Browse the repository at this point in the history
  • Loading branch information
jhao104 committed Jul 19, 2019
1 parent d3dfcf8 commit ba5d770
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 50 deletions.
7 changes: 2 additions & 5 deletions Config/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@ class ConfigError(BaseException):
"freeProxy05",
"freeProxy06",
"freeProxy07",
"freeProxyTwelve",
# foreign website, outside the wall
# "freeProxyWallFirst",
# "freeProxyWallSecond",
# "freeProxyWallThird"
"freeProxy08",
"freeProxy09",
]

# # API config http://127.0.0.1:5010
Expand Down
87 changes: 42 additions & 45 deletions ProxyGetter/getFreeProxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def freeProxy07():
yield ":".join(proxy)

@staticmethod
def freeProxyEleven():
def freeProxy08():
"""
IP海 http://www.iphai.com/free/ng
:return:
Expand All @@ -220,11 +220,10 @@ def freeProxyEleven():
yield ":".join(proxy)

@staticmethod
def freeProxyTwelve(page_count=2):
def freeProxy09(page_count=2):
"""
http://ip.jiangxianli.com/?page=
免费代理库
超多量
:return:
"""
for i in range(1, page_count + 1):
Expand All @@ -236,44 +235,44 @@ def freeProxyTwelve(page_count=2):
for tr in tr_list:
yield tr.xpath("./td[2]/text()")[0] + ":" + tr.xpath("./td[3]/text()")[0]

@staticmethod
def freeProxyWallFirst():
"""
墙外网站 cn-proxy
:return:
"""
urls = ['http://cn-proxy.com/', 'http://cn-proxy.com/archives/218']
request = WebRequest()
for url in urls:
r = request.get(url, timeout=10)
proxies = re.findall(r'<td>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</td>[\w\W]<td>(\d+)</td>', r.text)
for proxy in proxies:
yield ':'.join(proxy)
# @staticmethod
# def freeProxy10():
# """
# 墙外网站 cn-proxy
# :return:
# """
# urls = ['http://cn-proxy.com/', 'http://cn-proxy.com/archives/218']
# request = WebRequest()
# for url in urls:
# r = request.get(url, timeout=10)
# proxies = re.findall(r'<td>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</td>[\w\W]<td>(\d+)</td>', r.text)
# for proxy in proxies:
# yield ':'.join(proxy)

@staticmethod
def freeProxyWallSecond():
"""
https://proxy-list.org/english/index.php
:return:
"""
urls = ['https://proxy-list.org/english/index.php?p=%s' % n for n in range(1, 10)]
request = WebRequest()
import base64
for url in urls:
r = request.get(url, timeout=10)
proxies = re.findall(r"Proxy\('(.*?)'\)", r.text)
for proxy in proxies:
yield base64.b64decode(proxy).decode()
# @staticmethod
# def freeProxy11():
# """
# https://proxy-list.org/english/index.php
# :return:
# """
# urls = ['https://proxy-list.org/english/index.php?p=%s' % n for n in range(1, 10)]
# request = WebRequest()
# import base64
# for url in urls:
# r = request.get(url, timeout=10)
# proxies = re.findall(r"Proxy\('(.*?)'\)", r.text)
# for proxy in proxies:
# yield base64.b64decode(proxy).decode()

@staticmethod
def freeProxyWallThird():
urls = ['https://list.proxylistplus.com/Fresh-HTTP-Proxy-List-1']
request = WebRequest()
for url in urls:
r = request.get(url, timeout=10)
proxies = re.findall(r'<td>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</td>[\s\S]*?<td>(\d+)</td>', r.text)
for proxy in proxies:
yield ':'.join(proxy)
# @staticmethod
# def freeProxy12():
# urls = ['https://list.proxylistplus.com/Fresh-HTTP-Proxy-List-1']
# request = WebRequest()
# for url in urls:
# r = request.get(url, timeout=10)
# proxies = re.findall(r'<td>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</td>[\s\S]*?<td>(\d+)</td>', r.text)
# for proxy in proxies:
# yield ':'.join(proxy)


if __name__ == '__main__':
Expand All @@ -285,10 +284,8 @@ def freeProxyWallThird():
# CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy04)
# CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy05)
# CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy06)
CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy07)
# CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxyNinth)
# CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxyTen)
# CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxyEleven)
# CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxyTwelve)
# CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy07)
# CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy08)
# CheckProxy.checkGetProxyFunc(GetFreeProxy.freeProxy09)

# CheckProxy.checkAllGetProxyFunc()
CheckProxy.checkAllGetProxyFunc()

0 comments on commit ba5d770

Please sign in to comment.