|
|
@@ -16,7 +16,6 @@ import re
|
|
|
import sys
|
|
|
import requests
|
|
|
|
|
|
-
|
|
|
try:
|
|
|
from importlib import reload # py3 实际不会实用,只是为了不显示语法错误
|
|
|
except:
|
|
|
@@ -25,7 +24,7 @@ except:
|
|
|
|
|
|
sys.path.append('..')
|
|
|
from ProxyGetter.getFreeProxy import GetFreeProxy
|
|
|
-from Util.GetConfig import GetConfig
|
|
|
+from Config.ConfigGetter import config
|
|
|
|
|
|
|
|
|
# noinspection PyPep8Naming
|
|
|
@@ -34,15 +33,15 @@ def testGetFreeProxy():
|
|
|
test class GetFreeProxy in ProxyGetter/GetFreeProxy
|
|
|
:return:
|
|
|
"""
|
|
|
- gc = GetConfig()
|
|
|
- proxy_getter_functions = gc.proxy_getter_functions
|
|
|
+ proxy_getter_functions = config.proxy_getter_functions
|
|
|
for proxyGetter in proxy_getter_functions:
|
|
|
proxy_count = 0
|
|
|
for proxy in getattr(GetFreeProxy, proxyGetter.strip())():
|
|
|
if proxy:
|
|
|
- print('{func}: fetch proxy {proxy},proxy_count:{proxy_count}'.format(func=proxyGetter, proxy=proxy,proxy_count=proxy_count))
|
|
|
+ print('{func}: fetch proxy {proxy},proxy_count:{proxy_count}'.format(func=proxyGetter, proxy=proxy,
|
|
|
+ proxy_count=proxy_count))
|
|
|
proxy_count += 1
|
|
|
- #assert proxy_count >= 20, '{} fetch proxy fail'.format(proxyGetter)
|
|
|
+ # assert proxy_count >= 20, '{} fetch proxy fail'.format(proxyGetter)
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|