|
|
@@ -10,6 +10,9 @@
|
|
|
2016/11/25: proxyFetcher
|
|
|
-------------------------------------------------
|
|
|
"""
|
|
|
+import base64
|
|
|
+
|
|
|
+
|
|
|
__author__ = 'JHao'
|
|
|
|
|
|
import re
|
|
|
@@ -279,3 +282,20 @@ class ProxyFetcher(object):
|
|
|
ips = re.findall(r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{1,5}", r.text)
|
|
|
for ip in ips:
|
|
|
yield ip.strip()
|
|
|
+
|
|
|
+ @staticmethod
|
|
|
+ def freeProxy15():
|
|
|
+ urls=[
|
|
|
+ 'https://www.xroxy.com/proxylist.php?port=&type=All_http&ssl=&country=&latency=&reliability=#table',
|
|
|
+ 'https://www.xroxy.com/proxylist.php?port=&type=All_http&ssl=&country=&latency=&reliability=&sort=reliability&desc=true&pnum=1#table',
|
|
|
+ 'https://www.xroxy.com/proxylist.php?port=&type=All_http&ssl=&country=&latency=&reliability=&sort=reliability&desc=true&pnum=2#table',
|
|
|
+ 'https://www.xroxy.com/proxylist.php?port=&type=All_http&ssl=&country=&latency=&reliability=&sort=reliability&desc=true&pnum=3#table',
|
|
|
+ 'https://www.xroxy.com/proxylist.php?port=&type=All_http&ssl=&country=&latency=&reliability=&sort=reliability&desc=true&pnum=4#table',
|
|
|
+ ]
|
|
|
+ for url in urls:
|
|
|
+ r = WebRequest().get(url, timeout=10)
|
|
|
+ proxies = re.findall(
|
|
|
+ r'<td.*?>[\s\S]*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})[\s\S]*?</td>[\s\S]*?<td.*?>[\s\S]*?(\d+)[\s\S]*?</td>',
|
|
|
+ r.text)
|
|
|
+ for proxy in proxies:
|
|
|
+ yield ':'.join(proxy)
|