소스 검색

添加一个代理网站
http://www.iphai.com

luocaodan 8 년 전
부모
커밋
e2433d39fc
2개의 변경된 파일20개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      Config.ini
  2. 18 0
      ProxyGetter/getFreeProxy.py

+ 2 - 0
Config.ini

@@ -19,9 +19,11 @@ freeProxySeventh = 1
 freeProxyEight = 1
 freeProxyNinth = 1
 freeProxyTen = 1
+freeProxyEleven = 1
 ;foreign website, outside the wall
 freeProxyWallFirst = 1
 freeProxyWallSecond = 1
+freeProxyWallThird = 1
 
 [HOST]
 ; API接口配置 http://127.0.0.1:5010

+ 18 - 0
ProxyGetter/getFreeProxy.py

@@ -249,6 +249,22 @@ class GetFreeProxy(object):
                 yield ":".join(proxy)
 
 
+    @staticmethod
+    def freeProxyEleven():
+        urls = [
+            'http://www.iphai.com/free/ng',
+            'http://www.iphai.com/free/np',
+            'http://www.iphai.com/free/wg',
+            'http://www.iphai.com/free/wp'
+        ]
+        request = WebRequest()
+        for url in urls:
+            r = request.get(url)
+            proxies = re.findall(r'<td>\s*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s*?</td>[\s\S]*?<td>\s*?(\d+)\s*?</td>', r.text)
+            for proxy in proxies:
+                yield ":".join(proxy)
+
+
     @staticmethod
     def freeProxyWallFirst():
         """
@@ -373,6 +389,8 @@ if __name__ == '__main__':
 
     # test_batch(gg.freeProxyTen())
 
+    # test_batch(gg.freeProxyEleven())
+
     # test_batch(gg.freeProxyWallFirst())
 
     # test_batch(gg.freeProxyWallSecond())